forked from boostorg/intrusive
* New treap-based containers: treap, treap_set, treap_multiset.
* Corrected compilation bug for Windows-based 64 bit compilers. * Corrected exception-safety bugs in container constructors. * Updated documentation to show rvalue-references funcions instead of emulation functions. [SVN r50259]
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2008.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -18,6 +18,7 @@
|
||||
#include<boost/intrusive/avltree.hpp>
|
||||
#include<boost/intrusive/sgtree.hpp>
|
||||
#include<boost/intrusive/splaytree.hpp>
|
||||
#include<boost/intrusive/treap.hpp>
|
||||
#include<boost/intrusive/hashtable.hpp>
|
||||
#include<boost/functional/hash.hpp>
|
||||
#include <vector> //std::vector
|
||||
@@ -48,8 +49,12 @@ class MyClass : public any_base_hook<>
|
||||
|
||||
friend std::size_t hash_value(const MyClass &o)
|
||||
{ return boost::hash<int>()(o.get()); }
|
||||
|
||||
friend bool priority_order(const MyClass &a, const MyClass &b)
|
||||
{ return a.int_ < b.int_; }
|
||||
};
|
||||
|
||||
|
||||
void instantiation_test()
|
||||
{
|
||||
typedef member_hook< MyClass, any_member_hook<>, &MyClass::member_hook_> MemberHook;
|
||||
@@ -96,6 +101,14 @@ void instantiation_test()
|
||||
sgtree < MyClass, any_to_bs_set_hook< MemberHook > > sgtree_member;
|
||||
sgtree_member.insert_unique(myclass);
|
||||
}
|
||||
{
|
||||
treap < MyClass, any_to_bs_set_hook< BaseHook > > treap_base;
|
||||
treap_base.insert_unique(myclass);
|
||||
}
|
||||
{
|
||||
treap < MyClass, any_to_bs_set_hook< MemberHook > > treap_member;
|
||||
treap_member.insert_unique(myclass);
|
||||
}
|
||||
{
|
||||
splaytree < MyClass, any_to_bs_set_hook< BaseHook > > splaytree_base;
|
||||
splaytree_base.insert_unique(myclass);
|
||||
|
||||
Reference in New Issue
Block a user