Commit Graph

648 Commits

Author SHA1 Message Date
Ion Gaztañaga
df03ffc8ec Fixes #241: flat_map should support same interface as std::map 2024-06-28 14:04:00 +02:00
Ion Gaztañaga
a070ce2325 Fixes #245 ("flat_tree::insert ordered range doesn't assert sorting") 2024-06-14 13:38:50 +02:00
Ion Gaztañaga
2d097fe45c Roll back and use dtl::value_init to maximize compatibility between std versions 2024-06-14 12:37:12 +02:00
Ion Gaztañaga
d1d8c43c2d Add detail/pair header 2024-06-13 22:46:37 +02:00
Ion Gaztañaga
acd4f41eda Remove unneeded header 2024-06-13 22:46:23 +02:00
Ion Gaztañaga
7c9fb0d764 Include pair.hpp since dtl::pair is used 2024-06-13 14:36:18 +02:00
Ion Gaztañaga
a331d3387f Include detail/is_pair.hpp since forward declares boost::tuples::tuple 2024-06-13 14:32:56 +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
13be16a0c8 Don't use default-constructed KeyNodeCompare to support stateful comparison objects 2024-06-05 11:20:11 +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
c7702d20eb Reformat small inline functions 2024-06-03 00:12:56 +02:00
Ion Gaztañaga
aa473160df Remove unused make_unique.hpp 2024-06-03 00:12:09 +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
4142050048 Disable Wstringop-xxx false positives also in newer GCCs 2024-06-02 13:06:33 +02:00
Ion Gaztañaga
0219333fa1 Disable strict aliasing for C++03 implementations as type-punning is used to make value_type movable. 2024-05-30 23:07:57 +02:00
Ion Gaztañaga
2f0155224b Disable Wstringop-overflow also in GCC 11 2024-05-27 22:50:47 +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
c09c9b5804 Avoid using transform iterator as null pointer dereferences might happen 2024-05-23 22:53:14 +02:00
Ion Gaztañaga
8d17978748 Document block_size option in deque_options 2024-05-21 14:16:18 +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
20ad12f20e Remove UB in flat_map implementation when the implementation has a movable std::pair 2024-04-28 23:29:59 +02:00
Ion Gaztañaga
429024ca4e Add experimental (macro protected) support for lighter iterators 2024-04-16 11:36:04 +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
978bbb113a Clean force_ptr usage and use launder_cast 2024-04-15 12:51:15 +02:00
Ion Gaztañaga
3c8c087eb7 Change internal_storage() implementation to avoid UBSan errors when N is zero. 2024-01-03 02:34:58 +01:00
Ion Gaztañaga
7c74232a40 Remove Boost.StaticAsser dependency 2024-01-02 19:46:05 +01:00
Ion Gaztañaga
4fcd7aea61 Workarounds to GCC-12 false positive warning 2023-05-10 22:14:25 +02: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
546ee5c06e Fixes #243 ("rebind makes build fail in boost::small_vector with libstdc++-13 and later ") 2023-04-20 23:35:48 +02:00
Ion Gaztañaga
8ae15965ea Fixes #242 ("Issue with string::rfind") 2023-04-18 22:50:30 +02:00
Ion Gaztañaga
51f6cf69fc Disable forceinline for clang compilers, see https://lists.boost.org/boost-users/2023/04/91445.php and https://github.com/llvm/llvm-project/issues/62202 2023-04-18 22:08:26 +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
db96d2ad47 Fixes #240 ("_GLIBCXX_DEBUG detects issues in flat_set/map") 2023-02-23 22:16:10 +01:00
Ion Gaztañaga
5cea4e8718 Fixes #236 ("flat_tree::erase_unique uses wrong iterator") 2023-02-13 10:04:07 +01:00
Ion Gaztañaga
8ec0bda4ba Fixes #237 ("there is no warning number /4675/4284/4345") 2023-02-13 09:05:39 +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
b3fd985101 Boost.Config is not needed 2023-01-23 14:01:53 +01:00
Ion Gaztañaga
0aa832cf18 Disable "-Warray-bounds" for GCC12 due to false positives 2023-01-18 23:55:44 +01:00
Ion Gaztañaga
5e31afe60f Remove unneeded file 2023-01-18 23:51:29 +01:00
Ion Gaztañaga
af381d82a0 Avoid dependency on boost::ignore_unused 2023-01-18 23:50:11 +01:00
Ion Gaztañaga
cfa3dda60e Add BOOST_CONTAINER_FORCEINLINE to trivial functions 2023-01-18 23:46:30 +01:00
Ion Gaztañaga
2e7983f997 Add missing boost/assert or static_assert include 2023-01-18 23:45:53 +01:00
Ion Gaztañaga
4e474cbd01 Remove experimental hash_xxx forward declarations 2022-12-12 01:00:30 +01:00
Ion Gaztañaga
2b8e3cfafe aligned_storage is no longer used in the implementation, so remove the header include. 2022-12-12 00:59:59 +01:00
Ion Gaztañaga
efde619997 Use remove_const to correctly extract key_type from value_type, as the typical case is pair<const KeyType, MappedType> 2022-12-12 00:43:49 +01:00
Ion Gaztañaga
d9ecdd8f67 Add BOOST_CONTAINER_FORCEINLINE in trivial functions 2022-12-12 00:42:14 +01:00