Commit Graph
75 Commits
Author SHA1 Message Date
Ion Gaztañaga d3ec5c677d Fixes #222 ("Fix incomplete type error when using list with pair") 2022-06-25 19:40:05 +02:00
Ion Gaztañaga ccf13f6770 Use Boost.Intrusive's key_of_value option to simplify the implementation 2022-06-13 00:49:43 +02:00
Ion Gaztañaga f8595fc39f Rename Rename "real_key_of_value" to "tree_key_of_value" 2022-03-10 10:29:24 +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 3f76f9fdf7 Fixes #206 ("operator-> on static_vector::iterator causes cast alignment warning") 2021-12-28 15:17:15 +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 1cc35bbc98 Fixes #187 ("flat_map::erase and unique keys") 2021-08-08 00:38:29 +02: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 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
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 5f0ce60b39 Fixes #88 ("Implement C++17 MoveAssignable requirements for self-move assignments") 2019-04-30 18:05:50 +02: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 e787c4a24d Use uninitialized memory for node-based containers to improve aliasing conformance 2018-09-26 01:10:37 +02:00
Ion Gaztañaga 5ab5c7de63 Add noexcept_if to tree::swap 2018-09-15 01:18:27 +02:00
Ion Gaztañaga 139db663a3 * Implemented C++20 contains() for associative containers as specified in P0458R2.
* Fixed serious bug in heterogeneous lookup functions (is_transparent was broken).
2018-08-13 15:36:00 +02:00
Ion Gaztañaga 48c21e3187 Implemented C++14's heterogeneous lookups. 2018-05-01 14:55:24 +02: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 ec91367383 Review all associative containers and implement a different constructor overload to avoid any unnecessary copy construction of the predicate or the allocator. 2017-05-16 16:29:49 +02:00
Mehdi Amini 40451e4bf7 Add variant of map constructors to avoid useless extra allocator copy when using initializer list
Many existing constructors have this form:

  map(std::initializer_list<value_type> il, const Compare& comp = Compare(), const allocator_type& a = allocator_type())

The issue is that a temporary allocator_type is constructed, and
passed to the base class where it is used to copy-constructed the
rebound allocator.
This temporary allocator_type here is always destroyed at the end
of the map() constructor. For stateful allocators this is not
desirable.
The solution is to adopt what libc++ is doing and have to constructors:

  map(std::initializer_list<value_type> il, const Compare& comp = Compare(), const allocator_type& a)

and

  map(std::initializer_list<value_type> il, const Compare& comp = Compare())

This way, unless an allocator is provided by the client, no extra temporary
creation/destruction occurs.
2017-05-08 12:39:06 -07:00
Ion Gaztañaga 01d7c71ea8 Fix node_handle bugs:
-> Bad allocator destruction in swap
-> Wrong assertion in operator=
-> Make dangerous functions private

Added full testsuite.
2017-04-02 00:20:38 +02:00
Ion Gaztañaga f540b83ccd * Implemented merge operations for associative containers.
* Update tree-based containers to changes done in Intrusive internal utilities in order to fix Trac 12432.
2016-09-03 00:03:42 +02:00
Ion Gaztañaga 9f9fdeaa9a Adapt to Intrusive change that removed unneeded template parameters to tree_value_compare. 2016-08-29 16:53:17 +02:00
Ion Gaztañaga 4298d1984b * Add missing extract() and insert(node_type) funtion to associative containers.
* Simplify select1st
2016-08-29 00:06:57 +02:00
Ion Gaztañaga 1467c51a4e Implemented missing try_emplace member for maps. 2016-08-26 01:47:32 +02:00
Ion Gaztañaga 2d6f781a2f Implemented "insert_or_assign" for map-like containers. 2016-08-18 20:29:04 +02:00
Ion Gaztañaga 225e2da77e Revised noexcept expressions of default and move constructors in all containers. 2016-08-01 23:49:51 +02:00
Ion Gaztañaga a7158c7975 Fixed Trac #12014: "boost::container::set can not insert const (ref) range" 2016-02-24 10:13:07 +01:00
Ion Gaztañaga 75f7c8fa73 Introduced BOOST_CONTAINER_FORCEINLINE so that mandatory inlining can be disabled selectively 2015-12-24 10:22:38 +01:00
Ion Gaztañaga a3262c0ae7 Fix for Trac #11820 ("compiler error when using operator[] of map") 2015-12-24 01:14:10 +01:00
Ion Gaztañaga c4505003c7 Minimize ifdef-ed code for BOOST_MOVE_HELPERS_RETURN_SFINAE_BROKEN 2015-10-17 10:17:30 +02:00
Ion Gaztañaga 1d5c367d62 Use BOOST_MOVE_HELPERS_RETURN_SFINAE_BROKEN as some compilers prefer return type SFINAE while others don't support it. 2015-10-17 09:39:56 +02:00
Ion Gaztañaga 7764e05444 Changes to support GCC 3.4 2015-10-12 18:51:08 +02:00
Ion Gaztañaga 85b2ed509b Added debug assertions via BOOST_ASSERT to check preconditions in several members. All checks are O(1) 2015-09-18 14:39:17 +02:00
Ion Gaztañaga e198da5946 Use Intrusive's tree_value_compare class instead of duplicating code 2015-06-04 11:42:47 +02:00
Ion Gaztañaga 6477543f3b Updated to new meta-functions reused from Intrusive/Move 2015-04-14 15:21:46 +02:00
Ion Gaztañaga c2ea5da716 Fix move constructors with unequal allocators and move/copy assignment of tree. 2015-02-26 00:22:23 +01:00
Ion Gaztañaga 10d027aa9c Include boost/config.hpp before testinG BOOST_HAS_PRAGMA_ONCE. 2015-02-02 15:26:53 +01:00
Ion Gaztañaga b786c8f716 Replaced BOOST_CONTIANER_NOEXCEPT with BOOST_NOEXCEPT 2015-01-28 22:11:00 +01:00
Ion Gaztañaga dbafd61d4d updated move assignments and swap operations to "N4258: Cleaning-up noexcept in the Library, Rev 3" with some customizations. 2015-01-19 00:18:44 +01:00
Ion Gaztañaga a322203a89 Replaced _MSC_VER with BOOST_HAS_PRAGMA_ONCE before #pragma once. 2015-01-10 12:50:17 +01:00
Ion Gaztañaga 360957a797 Massive dependency reduction. Removed dependency on several boost libraries and standard C++ headers. 2015-01-02 19:34:21 +01:00
Ion Gaztañaga 7971dc6602 Refactored uses of <iterator> and <algorithm> to avoid dependencies where possible. 2014-11-26 07:08:06 +01:00
Ion Gaztañaga d514c1ab66 Refactored comparison functors to reuse compare_functors.hpp classes 2014-11-23 10:07:12 +01:00
Ion Gaztañaga 6f1f162cb3 - Added nth and index_of.
- Used BOOST_MOVE_BASE
2014-11-01 20:03:25 +01:00
Ion Gaztañaga 6d034733bd Added missing #pragma once 2014-10-13 23:26:01 +02:00
Ion Gaztañaga 3af96e0801 Implements N3644.
- Avoid deriving from std::iterator_traits as iterators become too fat.
- Use intrusive's reverse_iterator some std::reverse_iterator-s don't value initialize base.
2014-09-24 16:09:56 +02:00
mikael 59b46cd338 Fixes a small issue that prevented the use of iterators of containers of incomplete types. Added iterators of incomp-types to unit-tests. 2014-09-21 19:46:58 -04:00
Ion Gaztañaga 3025cc41b6 Replace "boost/move/utility.hpp" with "boost/move/utility_core.hpp" to minimize dependencies. 2014-09-17 23:36:23 +02:00