382 Commits

Author SHA1 Message Date
Ion Gaztañaga
aa35950ca0 Add shrink_to_fit tests to small_vector 2024-06-03 00:14:25 +02:00
Rene Rivera
5f43b093c7 Sync from upstream. 2024-06-02 13:50:52 -05: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
7ec7de921c Remove unused or unneeded _id member 2024-05-30 23:12:52 +02:00
Rene Rivera
af24268fbb Sync from upstream. 2024-05-30 11:21:12 -05:00
Ion Gaztañaga
f46ee4391f Protect struct POD definition with the same macro as the test 2024-05-28 10:51:33 +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
Rene Rivera
9fea4700ca Sync from upstream. 2024-04-20 15:33:32 -05:00
Ion Gaztañaga
978bbb113a Clean force_ptr usage and use launder_cast 2024-04-15 12:51:15 +02:00
Ion Gaztañaga
56cc38f761 Update test_iterator_random test for vector-like containers 2024-04-15 11:57:44 +02:00
Rene Rivera
1c17646cd0 Make the library modular usable. 2024-03-11 08:31:01 -05:00
Ion Gaztañaga
6e697d7968 Rewrite default_init_test() to make harder for the compiler to optimize because we rely on UB to test memory was not initialized. 2024-01-04 00:59:38 +01:00
Ion Gaztañaga
514e88b376 Remove unneeded header 2024-01-03 02:32:41 +01:00
Ion Gaztañaga
7c74232a40 Remove Boost.StaticAsser dependency 2024-01-02 19:46:05 +01:00
Ion Gaztañaga
b14e7cedb0 libc++ up to version 14 does not support span deduction guides 2023-05-16 12:13:15 +02:00
Ion Gaztañaga
b8b089730a Disable test for clang with libstdc++ as clang triggers an error parsing STL headers with concepts (stl_iterator.h: error: requires clause differs in template redeclaration") 2023-05-11 21:14:19 +02:00
Ion Gaztañaga
e99536c535 Remove unused variable 2023-05-11 21:13:32 +02:00
Ion Gaztañaga
eda6b8dd83 Correct testcase that was failing in GCC-12 2023-05-10 22:16:00 +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
Giuseppe D'Angelo
b694ada294 Do not memset(0) POD types
"POD" is the wrong type trait to determine if something can be safely
zero-filled in order to achieve zero initialization. Consider a type
like

  struct POD { int POD::*ptr; };

This is a POD; its value initialization needs to value initialize the
member, and since it's a pointer, that's zero initialization, and that's
setting the pointer to null.

On Itanium, a null pointer to data member is not zero filled; it actually
has the value -1u.

Hence, zero-filling via memset(0) a POD object like the one above is
erroneous. Unfortunately there is no type trait in C++ that we can use to
know if a given datatype can be value initialized by zero-filling -- we
can check for trivial constructability, but that's a necessary
condition, not a sufficient one (POD above is also trivially
constructible).

The test is disabled on MSVC because of a compiler bug.

Fixes #238
2023-02-02 11:29:53 +01:00
Ion Gaztañaga
552688c7fc Simplify dependencies dropping Boost.Core 2023-02-01 23:00:23 +01:00
Ion Gaztañaga
855ff7707b Use "unsigned long long" for wchar_t sprintf_number algorithm to avoid warnings in Win64 2022-12-12 00:50:27 +01:00
Ion Gaztañaga
4bed49ee14 Reworked devector's relocation options, instead of relocation_limit<relocation_limit_XX>, it's specified by single "relocate_on_XX" 2022-10-01 23:39:28 +02: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
8b27fefb8e throw_bad_alloc in expand_bwd_test_allocator::allocation_command in case of a bad request 2022-08-24 14:48:59 +02:00
Ion Gaztañaga
c49b11aec8 Disable buggy warnings using config begin/end 2022-08-24 14:42:30 +02:00
Ion Gaztañaga
8372576905 - Add asserts to detect self-move bugs.
- Fix return type in life_count::check functions
2022-08-24 14:32:46 +02:00
Ion Gaztañaga
d98c21fc33 Fix potentially not-initialized variable warning 2022-08-24 14:31:28 +02:00
Ion Gaztañaga
34cd414280 Fixes #221 ("flat_set and friends should offer a const sequence_type& sequence() const method (...)") 2022-06-25 20:29:16 +02:00
Ion Gaztañaga
9182c07939 Add missing common_iterator_test from previous commit. 2022-01-12 01:40:42 +01:00
Ion Gaztañaga
2554e9671d Include <memory> as std::allocator is used 2022-01-04 16:43:20 +01:00
Ion Gaztañaga
8bb53bbed2 Make test_span_conversion() test a bit more clear 2022-01-04 16:42:43 +01:00
Ion Gaztañaga
15d61d6d26 Refactor node implemenations from 3 (slist_node, list_node and tree_node) to a single base_node:
- To avoid unneeded includes, is_pair is factored out from pair.hpp implementation
- Fixed bug where value_types inside nodes were not allocator-ware destructed.
- Changed scoped utilities to handle new clases
2022-01-04 00:41:34 +01:00
Ion Gaztañaga
53a020f1f1 Use BOOST_STATIC_ASSERT_MSG for constant checks 2022-01-04 00:36:36 +01:00
Ion Gaztañaga
fc8d0ff35c Remove unneeded "typename" 2021-12-31 01:14:06 +01:00
Ion Gaztañaga
2da6088d0c Improve test directly using transform_iterator and several containers 2021-12-31 01:03:11 +01:00
Ion Gaztañaga
0eb901ee05 Fix wrongly committed boost_iterator_comp_test version 2021-12-30 23:27:40 +01:00
Ion Gaztañaga
3750b66b38 Add minimal test to make sure boost iterator-like iterators are compatible with Boost.Container. Example taken from Trac 12698 (https://svn.boost.org/trac10/ticket/12698) 2021-12-30 23:16:26 +01:00
Ion Gaztañaga
6b29fbf90d Add overload for unsigned long long so that x64 builds work 2021-12-30 12:33:22 +01:00
Ion Gaztañaga
d691471816 Improve aliasing issues in C++03 that could lead to release tests failing in some tests 2021-12-29 23:44:18 +01:00
Ion Gaztañaga
6e2032717c Delete test causing false positive warning in GCC 11 2021-12-29 17:30:53 +01:00
Ion Gaztañaga
3f76f9fdf7 Fixes #206 ("operator-> on static_vector::iterator causes cast alignment warning") 2021-12-28 15:17:15 +01:00
Ion Gaztañaga
ea3521bf14 Fix -Wshadow warnings 2021-12-27 14:40:29 +01:00
Ion Gaztañaga
40735223d5 Added BOOST_OVERRIDE according to -Wsuggest-override 2021-12-27 01:01:10 +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
7f35ef420e Support Clang's -Wconversion -Wfloat-conversion -Wsign-conversion with -Werror 2021-10-20 00:18:05 +02: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