mirror of
https://github.com/boostorg/container.git
synced 2025-08-02 05:54:28 +02:00
Inherit set/multiset/map/multimap from tree to avoid redundant instantiations in debug mode and simplify maintenance.
This commit is contained in:
@@ -447,7 +447,7 @@ struct key_node_compare
|
||||
|
||||
template <class Key, class Value, class KeyOfValue,
|
||||
class KeyCompare, class A,
|
||||
class Options>
|
||||
class Options = tree_assoc_defaults>
|
||||
class tree
|
||||
: protected container_detail::node_alloc_holder
|
||||
< A
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -126,6 +126,64 @@ template class multimap
|
||||
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
|
||||
>;
|
||||
|
||||
namespace container_detail {
|
||||
|
||||
template class tree
|
||||
< const test::movable_and_copyable_int
|
||||
, std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int>
|
||||
, container_detail::select1st< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
|
||||
, std::less<test::movable_and_copyable_int>
|
||||
, test::dummy_test_allocator
|
||||
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
|
||||
, tree_assoc_defaults >;
|
||||
|
||||
template class tree
|
||||
< const test::movable_and_copyable_int
|
||||
, std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int>
|
||||
, container_detail::select1st< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
|
||||
, std::less<test::movable_and_copyable_int>
|
||||
, test::simple_allocator
|
||||
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
|
||||
, tree_assoc_defaults >;
|
||||
|
||||
template class tree
|
||||
< const test::movable_and_copyable_int
|
||||
, std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int>
|
||||
, container_detail::select1st< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
|
||||
, std::less<test::movable_and_copyable_int>
|
||||
, std::allocator
|
||||
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
|
||||
, tree_assoc_defaults >;
|
||||
|
||||
template class tree
|
||||
< const test::movable_and_copyable_int
|
||||
, std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int>
|
||||
, container_detail::select1st< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
|
||||
, std::less<test::movable_and_copyable_int>
|
||||
, allocator
|
||||
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
|
||||
, tree_assoc_defaults >;
|
||||
|
||||
template class tree
|
||||
< const test::movable_and_copyable_int
|
||||
, std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int>
|
||||
, container_detail::select1st< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
|
||||
, std::less<test::movable_and_copyable_int>
|
||||
, adaptive_pool
|
||||
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
|
||||
, tree_assoc_defaults >;
|
||||
|
||||
template class tree
|
||||
< const test::movable_and_copyable_int
|
||||
, std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int>
|
||||
, container_detail::select1st< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
|
||||
, std::less<test::movable_and_copyable_int>
|
||||
, node_allocator
|
||||
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
|
||||
, tree_assoc_defaults >;
|
||||
|
||||
} //container_detail {
|
||||
|
||||
}} //boost::container
|
||||
|
||||
class recursive_map
|
||||
|
@@ -102,6 +102,65 @@ template class multiset
|
||||
, node_allocator<test::movable_and_copyable_int>
|
||||
>;
|
||||
|
||||
namespace container_detail {
|
||||
|
||||
//Instantiate base class as previous instantiations don't instantiate inherited members
|
||||
template class tree
|
||||
< test::movable_and_copyable_int
|
||||
, test::movable_and_copyable_int
|
||||
, identity<test::movable_and_copyable_int>
|
||||
, std::less<test::movable_and_copyable_int>
|
||||
, test::dummy_test_allocator<test::movable_and_copyable_int>
|
||||
, tree_assoc_defaults
|
||||
>;
|
||||
|
||||
template class tree
|
||||
< test::movable_and_copyable_int
|
||||
, test::movable_and_copyable_int
|
||||
, identity<test::movable_and_copyable_int>
|
||||
, std::less<test::movable_and_copyable_int>
|
||||
, test::simple_allocator<test::movable_and_copyable_int>
|
||||
, tree_assoc_defaults
|
||||
>;
|
||||
|
||||
template class tree
|
||||
< test::movable_and_copyable_int
|
||||
, test::movable_and_copyable_int
|
||||
, identity<test::movable_and_copyable_int>
|
||||
, std::less<test::movable_and_copyable_int>
|
||||
, std::allocator<test::movable_and_copyable_int>
|
||||
, tree_assoc_defaults
|
||||
>;
|
||||
|
||||
template class tree
|
||||
< test::movable_and_copyable_int
|
||||
, test::movable_and_copyable_int
|
||||
, identity<test::movable_and_copyable_int>
|
||||
, std::less<test::movable_and_copyable_int>
|
||||
, allocator<test::movable_and_copyable_int>
|
||||
, tree_assoc_defaults
|
||||
>;
|
||||
|
||||
template class tree
|
||||
< test::movable_and_copyable_int
|
||||
, test::movable_and_copyable_int
|
||||
, identity<test::movable_and_copyable_int>
|
||||
, std::less<test::movable_and_copyable_int>
|
||||
, adaptive_pool<test::movable_and_copyable_int>
|
||||
, tree_assoc_defaults
|
||||
>;
|
||||
|
||||
template class tree
|
||||
< test::movable_and_copyable_int
|
||||
, test::movable_and_copyable_int
|
||||
, identity<test::movable_and_copyable_int>
|
||||
, std::less<test::movable_and_copyable_int>
|
||||
, node_allocator<test::movable_and_copyable_int>
|
||||
, tree_assoc_defaults
|
||||
>;
|
||||
|
||||
} //container_detail {
|
||||
|
||||
}} //boost::container
|
||||
|
||||
//Test recursive structures
|
||||
|
Reference in New Issue
Block a user