2013-12-23 23:34:28 +01:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// (C) Copyright Ion Gaztanaga 2004-2013. Distributed under the Boost
|
|
|
|
|
// Software License, Version 1.0. (See accompanying file
|
|
|
|
|
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
|
//
|
|
|
|
|
// See http://www.boost.org/libs/container for documentation.
|
|
|
|
|
//
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
#include <boost/container/detail/config_begin.hpp>
|
|
|
|
|
#include <set>
|
|
|
|
|
#include <boost/container/set.hpp>
|
|
|
|
|
#include <boost/container/allocator.hpp>
|
|
|
|
|
#include <boost/container/node_allocator.hpp>
|
|
|
|
|
#include <boost/container/adaptive_pool.hpp>
|
|
|
|
|
|
|
|
|
|
#include "print_container.hpp"
|
|
|
|
|
#include "movable_int.hpp"
|
|
|
|
|
#include "dummy_test_allocator.hpp"
|
|
|
|
|
#include "set_test.hpp"
|
|
|
|
|
#include "propagate_allocator_test.hpp"
|
|
|
|
|
#include "emplace_test.hpp"
|
|
|
|
|
|
|
|
|
|
using namespace boost::container;
|
|
|
|
|
|
|
|
|
|
namespace boost {
|
|
|
|
|
namespace container {
|
|
|
|
|
|
|
|
|
|
//Explicit instantiation to detect compilation errors
|
|
|
|
|
|
|
|
|
|
//set
|
|
|
|
|
template class set
|
|
|
|
|
< test::movable_and_copyable_int
|
|
|
|
|
, std::less<test::movable_and_copyable_int>
|
|
|
|
|
, test::dummy_test_allocator<test::movable_and_copyable_int>
|
|
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
template class set
|
|
|
|
|
< test::movable_and_copyable_int
|
|
|
|
|
, std::less<test::movable_and_copyable_int>
|
|
|
|
|
, test::simple_allocator<test::movable_and_copyable_int>
|
|
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
template class set
|
|
|
|
|
< test::movable_and_copyable_int
|
|
|
|
|
, std::less<test::movable_and_copyable_int>
|
|
|
|
|
, std::allocator<test::movable_and_copyable_int>
|
|
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
template class set
|
|
|
|
|
< test::movable_and_copyable_int
|
|
|
|
|
, std::less<test::movable_and_copyable_int>
|
|
|
|
|
, allocator<test::movable_and_copyable_int>
|
|
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
template class set
|
|
|
|
|
< test::movable_and_copyable_int
|
|
|
|
|
, std::less<test::movable_and_copyable_int>
|
|
|
|
|
, adaptive_pool<test::movable_and_copyable_int>
|
|
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
template class set
|
|
|
|
|
< test::movable_and_copyable_int
|
|
|
|
|
, std::less<test::movable_and_copyable_int>
|
|
|
|
|
, node_allocator<test::movable_and_copyable_int>
|
|
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
//multiset
|
|
|
|
|
template class multiset
|
|
|
|
|
< test::movable_and_copyable_int
|
|
|
|
|
, std::less<test::movable_and_copyable_int>
|
|
|
|
|
, test::dummy_test_allocator<test::movable_and_copyable_int>
|
|
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
template class multiset
|
|
|
|
|
< test::movable_and_copyable_int
|
|
|
|
|
, std::less<test::movable_and_copyable_int>
|
|
|
|
|
, test::simple_allocator<test::movable_and_copyable_int>
|
|
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
template class multiset
|
|
|
|
|
< test::movable_and_copyable_int
|
|
|
|
|
, std::less<test::movable_and_copyable_int>
|
|
|
|
|
, std::allocator<test::movable_and_copyable_int>
|
|
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
template class multiset
|
|
|
|
|
< test::movable_and_copyable_int
|
|
|
|
|
, std::less<test::movable_and_copyable_int>
|
|
|
|
|
, allocator<test::movable_and_copyable_int>
|
|
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
template class multiset
|
|
|
|
|
< test::movable_and_copyable_int
|
|
|
|
|
, std::less<test::movable_and_copyable_int>
|
|
|
|
|
, adaptive_pool<test::movable_and_copyable_int>
|
|
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
template class multiset
|
|
|
|
|
< test::movable_and_copyable_int
|
|
|
|
|
, std::less<test::movable_and_copyable_int>
|
|
|
|
|
, node_allocator<test::movable_and_copyable_int>
|
|
|
|
|
>;
|
|
|
|
|
|
2014-01-05 22:36:01 +01:00
|
|
|
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 {
|
|
|
|
|
|
2013-12-23 23:34:28 +01:00
|
|
|
}} //boost::container
|
|
|
|
|
|
|
|
|
|
//Test recursive structures
|
|
|
|
|
class recursive_set
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
recursive_set & operator=(const recursive_set &x)
|
|
|
|
|
{ id_ = x.id_; set_ = x.set_; return *this; }
|
|
|
|
|
|
|
|
|
|
int id_;
|
|
|
|
|
set<recursive_set> set_;
|
|
|
|
|
friend bool operator< (const recursive_set &a, const recursive_set &b)
|
|
|
|
|
{ return a.id_ < b.id_; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//Test recursive structures
|
|
|
|
|
class recursive_multiset
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
recursive_multiset & operator=(const recursive_multiset &x)
|
|
|
|
|
{ id_ = x.id_; multiset_ = x.multiset_; return *this; }
|
|
|
|
|
|
|
|
|
|
int id_;
|
|
|
|
|
multiset<recursive_multiset> multiset_;
|
|
|
|
|
friend bool operator< (const recursive_multiset &a, const recursive_multiset &b)
|
|
|
|
|
{ return a.id_ < b.id_; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<class C>
|
|
|
|
|
void test_move()
|
|
|
|
|
{
|
|
|
|
|
//Now test move semantics
|
|
|
|
|
C original;
|
|
|
|
|
original.emplace();
|
|
|
|
|
C move_ctor(boost::move(original));
|
|
|
|
|
C move_assign;
|
|
|
|
|
move_assign.emplace();
|
|
|
|
|
move_assign = boost::move(move_ctor);
|
|
|
|
|
move_assign.swap(original);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<class T, class A>
|
2013-12-24 19:00:52 +01:00
|
|
|
class set_propagate_test_wrapper
|
2014-01-03 13:26:57 +01:00
|
|
|
: public boost::container::set<T, std::less<T>, A
|
2014-05-28 15:50:13 +02:00
|
|
|
//tree_assoc_defaults
|
2014-01-03 13:26:57 +01:00
|
|
|
>
|
2013-12-23 23:34:28 +01:00
|
|
|
{
|
2013-12-24 19:00:52 +01:00
|
|
|
BOOST_COPYABLE_AND_MOVABLE(set_propagate_test_wrapper)
|
2014-01-03 13:26:57 +01:00
|
|
|
typedef boost::container::set<T, std::less<T>, A > Base;
|
2013-12-23 23:34:28 +01:00
|
|
|
public:
|
2013-12-24 19:00:52 +01:00
|
|
|
set_propagate_test_wrapper()
|
2013-12-23 23:34:28 +01:00
|
|
|
: Base()
|
|
|
|
|
{}
|
|
|
|
|
|
2013-12-24 19:00:52 +01:00
|
|
|
set_propagate_test_wrapper(const set_propagate_test_wrapper &x)
|
2013-12-23 23:34:28 +01:00
|
|
|
: Base(x)
|
|
|
|
|
{}
|
|
|
|
|
|
2013-12-24 19:00:52 +01:00
|
|
|
set_propagate_test_wrapper(BOOST_RV_REF(set_propagate_test_wrapper) x)
|
2013-12-23 23:34:28 +01:00
|
|
|
: Base(boost::move(static_cast<Base&>(x)))
|
|
|
|
|
{}
|
|
|
|
|
|
2013-12-24 19:00:52 +01:00
|
|
|
set_propagate_test_wrapper &operator=(BOOST_COPY_ASSIGN_REF(set_propagate_test_wrapper) x)
|
2013-12-23 23:34:28 +01:00
|
|
|
{ this->Base::operator=(x); return *this; }
|
|
|
|
|
|
2013-12-24 19:00:52 +01:00
|
|
|
set_propagate_test_wrapper &operator=(BOOST_RV_REF(set_propagate_test_wrapper) x)
|
2013-12-23 23:34:28 +01:00
|
|
|
{ this->Base::operator=(boost::move(static_cast<Base&>(x))); return *this; }
|
|
|
|
|
|
2013-12-24 19:00:52 +01:00
|
|
|
void swap(set_propagate_test_wrapper &x)
|
2013-12-23 23:34:28 +01:00
|
|
|
{ this->Base::swap(x); }
|
|
|
|
|
};
|
|
|
|
|
|
2014-01-03 13:26:57 +01:00
|
|
|
template<class VoidAllocator, boost::container::tree_type_enum tree_type_value>
|
2013-12-23 23:34:28 +01:00
|
|
|
struct GetAllocatorSet
|
|
|
|
|
{
|
|
|
|
|
template<class ValueType>
|
|
|
|
|
struct apply
|
|
|
|
|
{
|
|
|
|
|
typedef set < ValueType
|
|
|
|
|
, std::less<ValueType>
|
|
|
|
|
, typename allocator_traits<VoidAllocator>
|
|
|
|
|
::template portable_rebind_alloc<ValueType>::type
|
2014-01-03 13:26:57 +01:00
|
|
|
, typename boost::container::tree_assoc_options
|
|
|
|
|
< boost::container::tree_type<tree_type_value>
|
|
|
|
|
>::type
|
2013-12-23 23:34:28 +01:00
|
|
|
> set_type;
|
|
|
|
|
|
|
|
|
|
typedef multiset < ValueType
|
|
|
|
|
, std::less<ValueType>
|
|
|
|
|
, typename allocator_traits<VoidAllocator>
|
|
|
|
|
::template portable_rebind_alloc<ValueType>::type
|
2014-01-03 13:26:57 +01:00
|
|
|
, typename boost::container::tree_assoc_options
|
|
|
|
|
< boost::container::tree_type<tree_type_value>
|
|
|
|
|
>::type
|
2013-12-23 23:34:28 +01:00
|
|
|
> multiset_type;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2014-01-03 13:26:57 +01:00
|
|
|
template<class VoidAllocator, boost::container::tree_type_enum tree_type_value>
|
2013-12-23 23:34:28 +01:00
|
|
|
int test_set_variants()
|
|
|
|
|
{
|
2014-01-03 13:26:57 +01:00
|
|
|
typedef typename GetAllocatorSet<VoidAllocator, tree_type_value>::template apply<int>::set_type MySet;
|
|
|
|
|
typedef typename GetAllocatorSet<VoidAllocator, tree_type_value>::template apply<test::movable_int>::set_type MyMoveSet;
|
|
|
|
|
typedef typename GetAllocatorSet<VoidAllocator, tree_type_value>::template apply<test::movable_and_copyable_int>::set_type MyCopyMoveSet;
|
|
|
|
|
typedef typename GetAllocatorSet<VoidAllocator, tree_type_value>::template apply<test::copyable_int>::set_type MyCopySet;
|
2013-12-23 23:34:28 +01:00
|
|
|
|
2014-01-03 13:26:57 +01:00
|
|
|
typedef typename GetAllocatorSet<VoidAllocator, tree_type_value>::template apply<int>::multiset_type MyMultiSet;
|
|
|
|
|
typedef typename GetAllocatorSet<VoidAllocator, tree_type_value>::template apply<test::movable_int>::multiset_type MyMoveMultiSet;
|
|
|
|
|
typedef typename GetAllocatorSet<VoidAllocator, tree_type_value>::template apply<test::movable_and_copyable_int>::multiset_type MyCopyMoveMultiSet;
|
|
|
|
|
typedef typename GetAllocatorSet<VoidAllocator, tree_type_value>::template apply<test::copyable_int>::multiset_type MyCopyMultiSet;
|
2013-12-23 23:34:28 +01:00
|
|
|
|
|
|
|
|
typedef std::set<int> MyStdSet;
|
|
|
|
|
typedef std::multiset<int> MyStdMultiSet;
|
|
|
|
|
|
|
|
|
|
if (0 != test::set_test<
|
|
|
|
|
MySet
|
|
|
|
|
,MyStdSet
|
|
|
|
|
,MyMultiSet
|
|
|
|
|
,MyStdMultiSet>()){
|
|
|
|
|
std::cout << "Error in set_test<MyBoostSet>" << std::endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (0 != test::set_test<
|
|
|
|
|
MyMoveSet
|
|
|
|
|
,MyStdSet
|
|
|
|
|
,MyMoveMultiSet
|
|
|
|
|
,MyStdMultiSet>()){
|
|
|
|
|
std::cout << "Error in set_test<MyBoostSet>" << std::endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (0 != test::set_test<
|
|
|
|
|
MyCopyMoveSet
|
|
|
|
|
,MyStdSet
|
|
|
|
|
,MyCopyMoveMultiSet
|
|
|
|
|
,MyStdMultiSet>()){
|
|
|
|
|
std::cout << "Error in set_test<MyBoostSet>" << std::endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (0 != test::set_test<
|
|
|
|
|
MyCopySet
|
|
|
|
|
,MyStdSet
|
|
|
|
|
,MyCopyMultiSet
|
|
|
|
|
,MyStdMultiSet>()){
|
|
|
|
|
std::cout << "Error in set_test<MyBoostSet>" << std::endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main ()
|
|
|
|
|
{
|
|
|
|
|
//Recursive container instantiation
|
|
|
|
|
{
|
|
|
|
|
set<recursive_set> set_;
|
|
|
|
|
multiset<recursive_multiset> multiset_;
|
|
|
|
|
}
|
|
|
|
|
//Allocator argument container
|
|
|
|
|
{
|
|
|
|
|
set<int> set_((std::allocator<int>()));
|
|
|
|
|
multiset<int> multiset_((std::allocator<int>()));
|
|
|
|
|
}
|
|
|
|
|
//Now test move semantics
|
|
|
|
|
{
|
|
|
|
|
test_move<set<recursive_set> >();
|
|
|
|
|
test_move<multiset<recursive_multiset> >();
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-03 13:26:57 +01:00
|
|
|
////////////////////////////////////
|
|
|
|
|
// Testing allocator implementations
|
|
|
|
|
////////////////////////////////////
|
|
|
|
|
// std:allocator
|
|
|
|
|
if(test_set_variants< std::allocator<void>, red_black_tree >()){
|
2013-12-23 23:34:28 +01:00
|
|
|
std::cerr << "test_set_variants< std::allocator<void> > failed" << std::endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2014-01-03 13:26:57 +01:00
|
|
|
// boost::container::allocator
|
|
|
|
|
if(test_set_variants< allocator<void>, red_black_tree>()){
|
2013-12-23 23:34:28 +01:00
|
|
|
std::cerr << "test_set_variants< allocator<void> > failed" << std::endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2014-01-03 13:26:57 +01:00
|
|
|
// boost::container::node_allocator
|
|
|
|
|
if(test_set_variants< node_allocator<void>, red_black_tree>()){
|
2013-12-23 23:34:28 +01:00
|
|
|
std::cerr << "test_set_variants< node_allocator<void> > failed" << std::endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2014-01-03 13:26:57 +01:00
|
|
|
// boost::container::adaptive_pool
|
|
|
|
|
if(test_set_variants< adaptive_pool<void>, red_black_tree>()){
|
2013-12-23 23:34:28 +01:00
|
|
|
std::cerr << "test_set_variants< adaptive_pool<void> > failed" << std::endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-03 13:26:57 +01:00
|
|
|
////////////////////////////////////
|
|
|
|
|
// Tree implementations
|
|
|
|
|
////////////////////////////////////
|
|
|
|
|
// AVL
|
|
|
|
|
if(test_set_variants< std::allocator<void>, avl_tree >()){
|
|
|
|
|
std::cerr << "test_set_variants< std::allocator<void>, avl_tree > failed" << std::endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
// SCAPEGOAT TREE
|
|
|
|
|
if(test_set_variants< std::allocator<void>, scapegoat_tree >()){
|
|
|
|
|
std::cerr << "test_set_variants< std::allocator<void>, scapegoat_tree > failed" << std::endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
// SPLAY TREE
|
|
|
|
|
if(test_set_variants< std::allocator<void>, splay_tree >()){
|
|
|
|
|
std::cerr << "test_set_variants< std::allocator<void>, splay_tree > failed" << std::endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////
|
|
|
|
|
// Emplace testing
|
|
|
|
|
////////////////////////////////////
|
2013-12-23 23:34:28 +01:00
|
|
|
const test::EmplaceOptions SetOptions = (test::EmplaceOptions)(test::EMPLACE_HINT | test::EMPLACE_ASSOC);
|
|
|
|
|
if(!boost::container::test::test_emplace<set<test::EmplaceInt>, SetOptions>())
|
|
|
|
|
return 1;
|
|
|
|
|
if(!boost::container::test::test_emplace<multiset<test::EmplaceInt>, SetOptions>())
|
|
|
|
|
return 1;
|
2014-01-03 13:26:57 +01:00
|
|
|
|
|
|
|
|
////////////////////////////////////
|
|
|
|
|
// Allocator propagation testing
|
|
|
|
|
////////////////////////////////////
|
2013-12-24 19:00:52 +01:00
|
|
|
if(!boost::container::test::test_propagate_allocator<set_propagate_test_wrapper>())
|
2013-12-23 23:34:28 +01:00
|
|
|
return 1;
|
|
|
|
|
|
2014-01-03 13:26:57 +01:00
|
|
|
////////////////////////////////////
|
|
|
|
|
// Test optimize_size option
|
|
|
|
|
////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// set
|
|
|
|
|
//
|
|
|
|
|
typedef set< int*, std::less<int*>, std::allocator<int*>
|
|
|
|
|
, tree_assoc_options< optimize_size<false>, tree_type<red_black_tree> >::type > rbset_size_optimized_no;
|
|
|
|
|
typedef set< int*, std::less<int*>, std::allocator<int*>
|
|
|
|
|
, tree_assoc_options< optimize_size<true>, tree_type<red_black_tree> >::type > rbset_size_optimized_yes;
|
|
|
|
|
BOOST_STATIC_ASSERT(sizeof(rbset_size_optimized_yes) < sizeof(rbset_size_optimized_no));
|
|
|
|
|
|
|
|
|
|
typedef set< int*, std::less<int*>, std::allocator<int*>
|
|
|
|
|
, tree_assoc_options< optimize_size<false>, tree_type<avl_tree> >::type > avlset_size_optimized_no;
|
|
|
|
|
typedef set< int*, std::less<int*>, std::allocator<int*>
|
|
|
|
|
, tree_assoc_options< optimize_size<true>, tree_type<avl_tree> >::type > avlset_size_optimized_yes;
|
|
|
|
|
BOOST_STATIC_ASSERT(sizeof(avlset_size_optimized_yes) < sizeof(avlset_size_optimized_no));
|
|
|
|
|
//
|
|
|
|
|
// multiset
|
|
|
|
|
//
|
|
|
|
|
typedef multiset< int*, std::less<int*>, std::allocator<int*>
|
|
|
|
|
, tree_assoc_options< optimize_size<false>, tree_type<red_black_tree> >::type > rbmset_size_optimized_no;
|
|
|
|
|
typedef multiset< int*, std::less<int*>, std::allocator<int*>
|
|
|
|
|
, tree_assoc_options< optimize_size<true>, tree_type<red_black_tree> >::type > rbmset_size_optimized_yes;
|
|
|
|
|
BOOST_STATIC_ASSERT(sizeof(rbmset_size_optimized_yes) < sizeof(rbmset_size_optimized_no));
|
|
|
|
|
|
|
|
|
|
typedef multiset< int*, std::less<int*>, std::allocator<int*>
|
|
|
|
|
, tree_assoc_options< optimize_size<false>, tree_type<avl_tree> >::type > avlmset_size_optimized_no;
|
|
|
|
|
typedef multiset< int*, std::less<int*>, std::allocator<int*>
|
|
|
|
|
, tree_assoc_options< optimize_size<true>, tree_type<avl_tree> >::type > avlmset_size_optimized_yes;
|
|
|
|
|
BOOST_STATIC_ASSERT(sizeof(avlmset_size_optimized_yes) < sizeof(avlmset_size_optimized_no));
|
2013-12-23 23:34:28 +01:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#include <boost/container/detail/config_end.hpp>
|