Commit Graph
139 Commits
Author SHA1 Message Date
Ion Gaztañaga f6a03fd3f2 Fixes #197 ("small_vector::swap causes spurious allocations and suboptimal performance") 2021-11-01 00:19:16 +01:00
Ion Gaztañaga dad2cb2d02 Support GCC's -Wconversion -Wfloat-conversion -Warith-conversion -Wsign-conversion warnings. 2021-10-16 15:57:47 +02:00
Ion Gaztañaga ad7167c564 Fixes #150 ("Use std::contiguous_iterator_tag if available"), tested in MSVC and GCC. 2021-04-21 00:43:31 +02:00
Ion Gaztañaga d6a270e8e1 Correct "throws" part of several operations as the library by default throws its own exception types. 2021-01-02 16:24:37 +01:00
Pavel A. Lebedev cb1e6af53d Add conditional noexcept forwarding from free to member swap functions.
This allows std::is_nothrow_swappable{,_with} to work properly.
This only touches user-facing classes, with the following exceptions:
- map,set: only doc changes (with a drive-by missing semicolon fix),
  detail::tree which they derive from already forwards noexcept for swap.
- flat_set: only doc changes for flat_set and a change for
  detail::flat_tree, which it derives from to get swap.
- static_vector: while this adds the forwarding, member static_vector::swap
  is currently never noexcept, although it could be for noexcept-swappable
  and noexcept-move-constructible elements.
- small_vector: there is no free swap, and member swap is never noexcept,
  although it could be for noexcept-swappable and noexcept-move-
  constructible elements. Swapping small_vectors of exact same type goes
  through std::swap, which seems to get noexcept right, and small_vectors
  of different sizes use swap for boost::container::vector, which fails
  to detect when such swap could be noexcept. This patch doesn't touch
  small_vector.
- scoped_allocator: neither member nor free swap are noexcept, although
  they should be, and all other constructions/assignments/comparisons too,
  as they only forward these operations to underlying allocators, which
  are required to not throw exceptions for them. Only static_vector's
  static_storage_allocator might throw for these and it shouldn't appear
  in scoped_allocator. Unsure of the scope of changes needed or whether it
  is even worth it, this patch doesn't touch scoped_allocator.
2020-12-30 08:28:06 +03:00
Ion Gaztañaga 0a0ad0009e Add support for [[nodiscard]]:
- Decorate container and allocator functions.
- Make sure to disable warnings in tests
- Update doxygen documentation to support it
2020-11-05 14:24:35 +01:00
Ion Gaztañaga 03f030af69 Fixes #156: ("Compile error with vector") and remove warnings about precission loss due to integer narrowing 2020-10-22 01:10:07 +02:00
Ion Gaztañaga 5a52472cd0 Make a different version for single value proxies in priv_insert_forward_range_expand_forward and force-inline only that version 2020-08-11 23:50:47 +02:00
Ion Gaztañaga fb88180001 - Change priv_insert_forward_range_expand_forward position to raw pointer to be more homogeneous with the rest of similar functions.
- Remove some unused variable warnings due to BOOST_IF_CONSTEXPR additions.
2020-08-10 11:18:36 +02:00
Ion Gaztañaga 844b779a7d Clean-up insertion code and speed upt single value insertion for proxies having that trait. 2020-08-10 00:02:26 +02:00
Ion Gaztañaga bff516315b Add BOOST_CONTAINER_FORCEINLINE to more trivial functions 2020-08-10 00:00:51 +02:00
Ion Gaztañaga d271c6384d Use "set_stored_size" to avoid conversion warnings when updating member "stored_size_type types. 2020-08-09 23:54:24 +02:00
Ion Gaztañaga 2d9d28b81e Fixed #128 ("moved from small_vector and static_vector calls destructor on elements in static part") 2020-07-12 13:48:38 +02:00
Ion Gaztañaga 5d8e008c50 Fix initializer_list contructor allocation count 2020-07-12 11:05:34 +02:00
Ion Gaztañaga 52b9ae0e68 Fixes #145 ("Allocations not handled correctly in some cases of vector move with unequal allocators") 2020-05-25 00:35:07 +02:00
Ion Gaztañaga 649d6d0478 Add BOOST_CONTAINER_FORCEINLINE in more places 2020-05-25 00:14:15 +02:00
Mitsuru Kariya f25c767a2b Fix has_trivial_destructor_after_move
Most template type parameters 'Allocator' were modified their default type to void since 1.70.0.
These modifications cause has_trivial_destructor_after_move to compile error or yield wrong result.
So, fix them by changing specializations of has_trivial_destructor_after_move.
2019-06-01 22:36:54 +09:00
Ion Gaztañaga 5d96b11fe0 Added options to static_vector: throw_on_overflow/alignment 2019-05-09 13:25:50 +02:00
Ion Gaztañaga 24e420abe9 Add block size customization options to deque. 2019-04-28 19:18:22 +02:00
Ion Gaztañaga 8dfaee7434 Define nat in iterators to allow explicit instantiation of iterators. 2019-03-05 13:52:08 +01:00
Ion Gaztañaga da21340323 Fix #105 ("Fix gcc -Wdeprecated-copy") 2019-03-05 12:15:42 +01:00
Roland Dreier 1eb591e85c Fix deallocating never-allocated storage in vector.merge()
If merge() is called on an empty vector, then priv_merge_in_new_buffer() will
call deallocate() with size 0 on the old (not-yet-allocated) vector storage.
This violates the Allocator requirement that the pointer passed to deallocate()
must have come from a call to allocate() with the same size.

Fix this by checking old_cap against 0, and also add a unit test for this bug.
2019-02-23 18:46:06 -08:00
Ion Gaztañaga 83bb62fed3 Default allocator parameter changed form new_alloator<T> to void to reduce symbol lenghts 2019-01-10 22:54:58 +01:00
Ion Gaztañaga 4b6dd3ea9a Use void allocator by default in vector to reduce symbol lengths. Other containers will follow. 2019-01-03 01:44:09 +01:00
Ion Gaztañaga 43c0257871 Fixes issue #93 2018-12-01 12:58:54 +01:00
Ion Gaztañaga cb21746b80 Rewrite CTAD and SFINAE-out overloads as the standard requires 2018-11-12 22:52:45 +01:00
Ion Gaztañaga 2bc6f4d1a0 Fixes GitHub #84 ("Allow vector to be assigned to itself"). 2018-11-11 01:10:01 +01:00
Ion Gaztañaga 3a2f61fdb0 Merge branch 'container-misc-typos' of https://github.com/luzpaz/container into luzpaz-container-misc-typos 2018-11-10 23:32:42 +01:00
Ion Gaztañaga 10a618afe8 Fix GitHub #83: ("Iterator zero incrementing leads to assert on empty vector") 2018-11-10 23:12:46 +01:00
Ion Gaztañaga e787c4a24d Use uninitialized memory for node-based containers to improve aliasing conformance 2018-09-26 01:10:37 +02:00
luz.paz a6ac16d0c4 container: misc-typos
Found via `codespell -q 3 -L iff,nd`
2018-09-23 15:54:39 -04:00
Ion Gaztañaga fb0854bd08 Fix unused variable warning. 2018-09-15 00:50:51 +02:00
Ion Gaztañaga b56cbb60e0 Add assertions to invalid operations. 2018-06-27 16:50:58 +02:00
Ion Gaztañaga e9d10ce544 Fixes GitHub #75 ("flat_set: Heap overflow") 2018-06-26 21:50:05 +02:00
Ion Gaztañaga 62ee740368 Fixed GitHub #74 ("vector assignment not using memcpy") 2018-06-16 11:51:31 +02:00
Ion Gaztañaga 9a22431578 * Clean up constructor template auto deduction guides to use Boost.Container traits
* GitHub #73: '"triviality of pair".

* Fixed race condition bug in unsynchronized_pool_resource
2018-06-14 13:17:55 +02:00
Richard Powell 72195ae288 Adding Constructor Template Auto Deduction guides. 2018-05-11 11:35:25 -06:00
Ion Gaztañaga b3eee90a81 Fix ticket #13500: Memory leak when using erase on string vectors 2018-04-04 00:31:39 +02:00
Ion Gaztañaga 9abd56be5e Recover lost projects from solution 2017-12-31 19:38:11 +01:00
Ion Gaztañaga 6ce2b2d0f8 Add improved range insertion to flat associative containers and improve merge operation for vector. 2017-12-26 22:04:15 +01:00
Ion Gaztañaga 2802a1f50d - Add configuration options to vector
- Cleanup tree configuration options
2017-12-10 23:33:41 +01:00
Ion Gaztañaga fa2494631a Use namespace dtl instead of container_detail to avoid excessively long symbol names. 2017-11-07 00:51:46 +01:00
Ion Gaztañaga 21fbd71ef3 Delete BOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER 2017-08-27 01:03:24 +02:00
Ion Gaztañaga 1d727753e2 Use directly boost::movelib::to_raw_pointer/iterator_to_raw_pointer 2017-04-07 16:07:00 +02:00
Ion Gaztañaga a7e2bed8f1 Use adaptive_sort for merge operations. 2017-04-06 23:35:08 +02:00
Ion Gaztañaga 4d05ce8738 Fix for Ticket #12915: "Buffer overflow in boost::container::vector (affects flat_set)" 2017-03-28 12:37:22 +02:00
Ion Gaztañaga 1261ac3308 Fix emplace_back return type also in compilers without variadic templates. Update changelog. 2017-02-24 22:07:20 +01:00
Tobias Reh 5fe2dba504 emplace_back must return reference to back(), not to *end() 2017-02-24 15:33:30 +01:00
Ion Gaztañaga 764fcd88bf Merge branch 'copy_move_algo__parameter_fix' of https://github.com/think-cell/container into think-cell-copy_move_algo__parameter_fix 2016-11-13 00:26:58 +01:00
Ion Gaztañaga 238f37db22 Remove duplicated forceinline in push_back overloads 2016-11-12 19:08:24 +01:00