Inherit set/multiset/map/multimap from tree to avoid redundant instantiations in debug mode and simplify maintenance.

This commit is contained in:
Ion Gaztañaga
2014-01-05 22:36:01 +01:00
parent 3af1cdefe0
commit a93e23f22a
5 changed files with 560 additions and 950 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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