Commit Graph

553 Commits

Author SHA1 Message Date
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
30a4508371 Remove incorrect pair declaration 2022-01-04 00:37:07 +01:00
Ion Gaztañaga
576e15d6f6 Increase minimum version for forceinline usage in MSVC as bad code generation was detected in some cases 2022-01-04 00:24:27 +01:00
Ion Gaztañaga
b6020f5d73 Use BOOST_MOVE_TO_LV in pair to avoid potential UB 2022-01-02 00:26:44 +01:00
Ion Gaztañaga
2ed03bcba5 Delete forceinline attribute to the allocation function 2022-01-02 00:07:59 +01:00
Ion Gaztañaga
a111e9f369 Use BOOST_CONTAINER_FORCEINLINE with GCC > 5 due to some code generation errors detected in MinGW 2022-01-02 00:07:42 +01:00
Ion Gaztañaga
ef0eba34f6 Fix potential null pointer in memmove warning for GCC 2021-12-30 12:51:53 +01:00
Ion Gaztañaga
4301005b25 Remove some Wmaybe-uninitialized warnings for GCC 11 2021-12-29 23:43:44 +01:00
Ion Gaztañaga
ec73bd71e1 Fix -Wshadow warnings 2021-12-29 17:30:15 +01:00
Ion Gaztañaga
0e675a241a Fix maybe uninitilized read warnings.
Fix initial allocation functions
2021-12-29 17:29:48 +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
Dmitriy Babkov
2077adb0bc Fix documented Complexity of static_vector::reserve 2021-09-14 16:19:56 +03:00
Ion Gaztañaga
bcd41a1c64 - Add BOOST_CONTAINER_FORCEINLINE to trivial string internal functions
- Fixes #192 ("basic_string::clear() has poor codegen compared to STL implementations")
2021-09-13 14:19:38 +02:00
Ion Gaztañaga
1cc35bbc98 Fixes #187 ("flat_map::erase and unique keys") 2021-08-08 00:38:29 +02:00
Ion Gaztañaga
aaa2485ebf Fixes #188 ("Build fails when RTTI is disabled") 2021-08-08 00:06:01 +02:00
Ion Gaztañaga
15bed478eb Fixes #185 ("Including headers adds exports"), replacing BOOST_SYMBOL_EXPORT with BOOST_SYMBOL_VISIBLE. 2021-05-03 09:18:51 +02:00
Ion Gaztañaga
b7d48f1e08 Fixes #180: ("polymorphic_allocator's copy special member functions are not noexcept") 2021-04-21 00:53:43 +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
16cada57ea Fixes #184 ("Issues with custom exceptions implementation") 2021-04-19 21:52:55 +02:00
Ion Gaztañaga
1dc1e74668 Remove std::pair dependency for multiallocation_chain 2021-01-15 20:43:27 +01:00
Ion Gaztañaga
d2587837eb Use <boost/detail/interlocked.hpp> for interlocked operations 2021-01-15 18:05:15 +01:00
Ion Gaztañaga
26bf1d68be Add missing header for std::pair usage 2021-01-15 18:04:58 +01:00
Ion Gaztañaga
cce50a153d Use #include <boost/intrusive/detail/value_functors.hpp> instead of own value_functor.hpp 2021-01-05 10:10:57 +01:00
Ion Gaztañaga
482f0911e1 Use #include <boost/intrusive/detail/hash_combine.hpp> instead of #include <boost/container_hash/hash.hpp> to avoid pulling unneeded STL headers. 2021-01-05 00:07:02 +01:00
Ion Gaztañaga
95538bfdc2 Update static assert test and remove unneeded <string> include. 2021-01-02 22:47:19 +01:00
Ion Gaztañaga
2bd1a6f906 Add find_end algorithm and use it in string. 2021-01-02 17:03:15 +01:00
Ion Gaztañaga
5430c15ad9 Correct includes: <algorithm> is not used and <string> is needed for char_traits 2021-01-02 16:25:25 +01: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
Ion Gaztañaga
c476113411 Merge branch 'noexcept-swap' of https://github.com/palebedev/container into palebedev-noexcept-swap 2021-01-02 00:38:31 +01:00
Ion Gaztañaga
d7e99e56c6 Rewrite [flat_]map/set insert overloads to be more standard compliant. Fixes #102 ("flat_map::insert ambiguous with initializer list & pairs that need to convert"). 2021-01-01 23:50:50 +01:00
Ion Gaztañaga
621cd3a0ab Avoid using inheriting constructors and initializer_list::cbegin/cend to be nicer with older compilers 2021-01-01 23:44:56 +01:00
Ion Gaztañaga
6c23ce8b42 Avoid including windows.h 2021-01-01 23:44:07 +01:00
Ion Gaztañaga
80697e7c0f #pragma GCC diagnostic push is available from GCC 4.6, not from GCC 4.5 2021-01-01 23:43:44 +01:00
Ion Gaztañaga
d5a830434e - Replaced default standard exception classes with Boost.Container own classes, reducing considerably the included files overhead 2020-12-30 15:07:32 +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
b17dabf47a Fixes #141 ('small_vector does not propagate no throw properties of move operation of contained type') 2020-12-30 00:19:22 +01:00
Ion Gaztañaga
f50195524f As described in #139, fixed complexity of "merge", as a O(n) inplace merge is used and explicitly state all iterators are invalidated. 2020-11-14 23:31:30 +01:00
Ion Gaztañaga
93bbf37dad Fixes #139 ("flat_map merge and iterators"). 2020-11-14 00:10:46 +01:00
Ion Gaztañaga
ae93df82ea Fixes #164 ("Compile error when using pmr::map with a std::pair; works when using a std::tuple") 2020-11-13 23:43:02 +01:00
Ion Gaztañaga
2a458005d9 Fixes #171 ("deque::clear() uses undefined behaviour") 2020-11-10 10:08:03 +01: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
d4c8bd70ea Fixes #152 ("Tree-based containers have troubles with move-only types") 2020-10-31 23:09:52 +01:00
Peter Dimov
44c76d1187 Remove BOOST_CONTAINER_DECL from memory_resource 2020-10-24 23:51:15 +03: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
6ca40b9e86 Use custom placement new to support -fno-exceptions 2020-10-21 22:49:25 +02:00