Ion Gaztañaga
18a86594b6
Fix some Wshadow warnings for old GCCs
2024-09-30 15:59:00 +02:00
Ion Gaztañaga
49440c3525
Add compile-time check to make sure allocator_type::value_type and container's value_type are the same type.
2024-09-10 23:50:24 +02:00
Ion Gaztañaga
bd8c8b0327
Add unused_storage optimization function
2024-09-09 00:37:47 +02:00
Ion Gaztañaga
419b1e9f09
Fix merge[_unique] handling of input iterators. It was not handled at compile time, leading to compilation errors.
2024-09-08 00:47:43 +02:00
Ion Gaztañaga
a4c4c3b319
Define and use BOOST_CONTAINER_CONSTANT_VAR to support BOOST_INLINE_CONSTEXPR and static const global variables.
2024-06-06 14:39:49 +02:00
Ion Gaztañaga
0977e6b1d4
Use BOOST_STATIC_CONSTEXPR where applicable
2024-06-06 00:08:00 +02:00
Ion Gaztañaga
24c978b550
Clarify clear() does not alter capacith()
2024-06-04 14:00:31 +02:00
Ion Gaztañaga
dad179ddf5
Fix incorrect memory free order in prot_shrink_to_fit_small, fixing a potential memory leak
2024-06-03 00:14:00 +02:00
Ion Gaztañaga
9da5dc49f7
Refactor move constructor and swap implementations for small_vector as in some cass unnecesary heap allocation was performed. Add tests for this.
2024-06-02 13:08:18 +02:00
Ion Gaztañaga
397fbda8be
Fixes #280 ("Several containers don't support non-movable types when move assigning")
2024-05-23 23:28:54 +02:00
Ion Gaztañaga
292bab35c6
Revert accidental commit
2024-05-21 14:11:30 +02:00
Ion Gaztañaga
59d760c08b
Document block_size option in deque_options.
2024-05-21 14:08:36 +02:00
Ion Gaztañaga
03abe8c02c
Return start() pointer by value to limit aliasing
2024-04-15 12:53:41 +02:00
Ion Gaztañaga
7c74232a40
Remove Boost.StaticAsser dependency
2024-01-02 19:46:05 +01:00
Ion Gaztañaga
1a4a205ea6
Don't use BOOST_CONTAINER_FORCEINLINE extensively, due to potential code bloat
2023-05-10 22:09:01 +02:00
Ion Gaztañaga
5cc9617487
Fixes #233 ("Can't std::move small_vector with move-only type")
2023-03-13 10:06:53 +01:00
Ion Gaztañaga
552688c7fc
Simplify dependencies dropping Boost.Core
2023-02-01 23:00:23 +01:00
Ion Gaztañaga
704bf10058
Refactor advanced insertion algorithms and implement a new devector insert strategy, moving elements to the middle if there is a reasonable free capacity at the other end of the container.
2022-09-20 00:22:19 +02:00
Ion Gaztañaga
78de6f2bf2
Fix sign conversion warning
2022-03-06 21:17:27 +01:00
Ion Gaztañaga
3787fc3021
Fixes #207 ("boost.vector doesn't work with common_iterator")
2022-01-12 01:38:05 +01:00
Ion Gaztañaga
19e68ee050
Check Boost.Move's BOOST_MOVE_CONTIGUOUS_ITERATOR_TAG before using contiguous_iterator_tag
2022-01-04 16:44:07 +01:00
Ion Gaztañaga
2ed03bcba5
Delete forceinline attribute to the allocation function
2022-01-02 00:07:59 +01:00
Ion Gaztañaga
ea3521bf14
Fix -Wshadow warnings
2021-12-27 14:40:29 +01:00
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