forked from boostorg/intrusive
Merged missed changes for 1.47 release
[SVN r73279]
This commit is contained in:
1 parent
8a4edc41fe
commit
a5f5a18205
18 files changed
+648
-174
No files matched your search
@@ -16,6 +16,7 @@
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/intrusive/avltree.hpp>
|
||||
#include <boost/intrusive/detail/mpl.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
#include <iterator>
|
||||
|
||||
namespace boost {
|
||||
@@ -42,12 +43,8 @@ class avl_set_impl
|
||||
/// @cond
|
||||
typedef avltree_impl<Config> tree_type;
|
||||
//! This class is
|
||||
//! non-copyable
|
||||
avl_set_impl (const avl_set_impl&);
|
||||
|
||||
//! This class is
|
||||
//! non-assignable
|
||||
avl_set_impl &operator =(const avl_set_impl&);
|
||||
//! movable
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(avl_set_impl)
|
||||
|
||||
typedef tree_type implementation_defined;
|
||||
/// @endcond
|
||||
@@ -113,6 +110,17 @@ class avl_set_impl
|
||||
: tree_(true, b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
avl_set_impl(BOOST_RV_REF(avl_set_impl) x)
|
||||
: tree_(::boost::move(x.tree_))
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
avl_set_impl& operator=(BOOST_RV_REF(avl_set_impl) x)
|
||||
{ tree_ = ::boost::move(x.tree_); return *this; }
|
||||
|
||||
//! <b>Effects</b>: Detaches all elements from this. The objects in the avl_set
|
||||
//! are not deleted (i.e. no destructors are called).
|
||||
//!
|
||||
@@ -1181,6 +1189,7 @@ class avl_set
|
||||
#endif
|
||||
::type Base;
|
||||
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(avl_set)
|
||||
public:
|
||||
typedef typename Base::value_compare value_compare;
|
||||
typedef typename Base::value_traits value_traits;
|
||||
@@ -1202,6 +1211,13 @@ class avl_set
|
||||
: Base(b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
avl_set(BOOST_RV_REF(avl_set) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
avl_set& operator=(BOOST_RV_REF(avl_set) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
|
||||
static avl_set &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<avl_set &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
@@ -1238,9 +1254,8 @@ class avl_multiset_impl
|
||||
/// @cond
|
||||
typedef avltree_impl<Config> tree_type;
|
||||
|
||||
//Non-copyable and non-assignable
|
||||
avl_multiset_impl (const avl_multiset_impl&);
|
||||
avl_multiset_impl &operator =(const avl_multiset_impl&);
|
||||
//Movable
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(avl_multiset_impl)
|
||||
typedef tree_type implementation_defined;
|
||||
/// @endcond
|
||||
|
||||
@@ -1305,6 +1320,17 @@ class avl_multiset_impl
|
||||
: tree_(false, b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
avl_multiset_impl(BOOST_RV_REF(avl_multiset_impl) x)
|
||||
: tree_(::boost::move(x.tree_))
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
avl_multiset_impl& operator=(BOOST_RV_REF(avl_multiset_impl) x)
|
||||
{ tree_ = ::boost::move(x.tree_); return *this; }
|
||||
|
||||
//! <b>Effects</b>: Detaches all elements from this. The objects in the avl_multiset
|
||||
//! are not deleted (i.e. no destructors are called).
|
||||
//!
|
||||
@@ -2280,6 +2306,7 @@ class avl_multiset
|
||||
#endif
|
||||
::type Base;
|
||||
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(avl_multiset)
|
||||
public:
|
||||
typedef typename Base::value_compare value_compare;
|
||||
typedef typename Base::value_traits value_traits;
|
||||
@@ -2301,6 +2328,13 @@ class avl_multiset
|
||||
: Base(b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
avl_multiset(BOOST_RV_REF(avl_multiset) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
avl_multiset& operator=(BOOST_RV_REF(avl_multiset) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
|
||||
static avl_multiset &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<avl_multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <boost/intrusive/options.hpp>
|
||||
#include <boost/intrusive/avltree_algorithms.hpp>
|
||||
#include <boost/intrusive/link_mode.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
@@ -122,9 +123,8 @@ class avltree_impl
|
||||
private:
|
||||
typedef detail::size_holder<constant_time_size, size_type> size_traits;
|
||||
|
||||
//noncopyable
|
||||
avltree_impl (const avltree_impl&);
|
||||
avltree_impl operator =(const avltree_impl&);
|
||||
//noncopyable, movable
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(avltree_impl)
|
||||
|
||||
enum { safemode_or_autounlink =
|
||||
(int)real_value_traits::link_mode == (int)auto_unlink ||
|
||||
@@ -159,6 +159,12 @@ class avltree_impl
|
||||
value_compare &priv_comp()
|
||||
{ return data_.node_plus_pred_.get(); }
|
||||
|
||||
const value_traits &priv_value_traits() const
|
||||
{ return data_; }
|
||||
|
||||
value_traits &priv_value_traits()
|
||||
{ return data_; }
|
||||
|
||||
const node &priv_header() const
|
||||
{ return data_.node_plus_pred_.header_plus_size_.header_; }
|
||||
|
||||
@@ -241,6 +247,21 @@ class avltree_impl
|
||||
this->insert_equal(b, e);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
avltree_impl(BOOST_RV_REF(avltree_impl) x)
|
||||
: data_(::boost::move(x.priv_comp()), ::boost::move(x.priv_value_traits()))
|
||||
{
|
||||
node_algorithms::init_header(&priv_header());
|
||||
this->priv_size_traits().set_size(size_type(0));
|
||||
this->swap(x);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
avltree_impl& operator=(BOOST_RV_REF(avltree_impl) x)
|
||||
{ this->swap(x); return *this; }
|
||||
|
||||
//! <b>Effects</b>: Detaches all elements from this. The objects in the set
|
||||
//! are not deleted (i.e. no destructors are called), but the nodes according to
|
||||
//! the value_traits template parameter are reinitialized and thus can be reused.
|
||||
@@ -1274,6 +1295,8 @@ class avltree_impl
|
||||
node_algorithms::replace_node( get_real_value_traits().to_node_ptr(*replace_this)
|
||||
, node_ptr(&priv_header())
|
||||
, get_real_value_traits().to_node_ptr(with_this));
|
||||
if(safemode_or_autounlink)
|
||||
node_algorithms::init(replace_this.pointed_node());
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
|
||||
@@ -1604,6 +1627,8 @@ class avltree
|
||||
#endif
|
||||
::type Base;
|
||||
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(avltree)
|
||||
|
||||
public:
|
||||
typedef typename Base::value_compare value_compare;
|
||||
typedef typename Base::value_traits value_traits;
|
||||
@@ -1626,6 +1651,13 @@ class avltree
|
||||
: Base(unique, b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
avltree(BOOST_RV_REF(avltree) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
avltree& operator=(BOOST_RV_REF(avltree) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
|
||||
static avltree &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<avltree &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
#include <boost/intrusive/detail/slist_node.hpp> //remove-me
|
||||
#include <cstddef>
|
||||
#include <boost/pointer_cast.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
namespace detail {
|
||||
@@ -76,6 +79,10 @@ struct bucket_impl : public Slist
|
||||
template<class Slist>
|
||||
struct bucket_traits_impl
|
||||
{
|
||||
private:
|
||||
BOOST_COPYABLE_AND_MOVABLE(bucket_traits_impl)
|
||||
|
||||
public:
|
||||
/// @cond
|
||||
typedef typename boost::pointer_to_other
|
||||
< typename Slist::pointer, bucket_impl<Slist> >::type bucket_ptr;
|
||||
@@ -86,6 +93,21 @@ struct bucket_traits_impl
|
||||
: buckets_(buckets), buckets_len_(len)
|
||||
{}
|
||||
|
||||
bucket_traits_impl(BOOST_RV_REF(bucket_traits_impl) x)
|
||||
: buckets_(x.buckets_), buckets_len_(x.buckets_len_)
|
||||
{ x.buckets_ = bucket_ptr(0); x.buckets_len_ = 0; }
|
||||
|
||||
bucket_traits_impl& operator=(BOOST_RV_REF(bucket_traits_impl) x)
|
||||
{
|
||||
buckets_ = x.buckets_; buckets_len_ = x.buckets_len_;
|
||||
x.buckets_ = bucket_ptr(0); x.buckets_len_ = 0; return *this;
|
||||
}
|
||||
|
||||
bucket_traits_impl& operator=(BOOST_COPY_ASSIGN_REF(bucket_traits_impl) x)
|
||||
{
|
||||
buckets_ = x.buckets_; buckets_len_ = x.buckets_len_; return *this;
|
||||
}
|
||||
|
||||
bucket_ptr bucket_begin() const
|
||||
{ return buckets_; }
|
||||
|
||||
|
||||
@@ -138,6 +138,10 @@ template <typename T>
|
||||
struct is_unary_or_binary_function_impl
|
||||
{ static const bool value = false; };
|
||||
|
||||
// see boost ticket #4094
|
||||
// avoid duplicate definitions of is_unary_or_binary_function_impl
|
||||
#ifndef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
|
||||
|
||||
template <typename R>
|
||||
struct is_unary_or_binary_function_impl<R (*)()>
|
||||
{ static const bool value = true; };
|
||||
@@ -145,29 +149,17 @@ struct is_unary_or_binary_function_impl<R (*)()>
|
||||
template <typename R>
|
||||
struct is_unary_or_binary_function_impl<R (*)(...)>
|
||||
{ static const bool value = true; };
|
||||
/*
|
||||
#ifdef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
|
||||
|
||||
#else // BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
|
||||
|
||||
template <typename R>
|
||||
struct is_unary_or_binary_function_impl<R (__stdcall*)()>
|
||||
{ static const bool value = true; };
|
||||
|
||||
template <typename R>
|
||||
struct is_unary_or_binary_function_impl<R (__stdcall*)(...)>
|
||||
{ static const bool value = true; };
|
||||
|
||||
template <typename R>
|
||||
struct is_unary_or_binary_function_impl<R (__stdcall*)(...)>
|
||||
{ static const bool value = true; };
|
||||
|
||||
template <typename R>
|
||||
struct is_unary_or_binary_function_impl<R (__fastcall*)()>
|
||||
{ static const bool value = true; };
|
||||
|
||||
template <typename R>
|
||||
struct is_unary_or_binary_function_impl<R (__fastcall*)(...)>
|
||||
{ static const bool value = true; };
|
||||
|
||||
template <typename R>
|
||||
struct is_unary_or_binary_function_impl<R (__cdecl*)()>
|
||||
{ static const bool value = true; };
|
||||
@@ -175,8 +167,13 @@ struct is_unary_or_binary_function_impl<R (__cdecl*)()>
|
||||
template <typename R>
|
||||
struct is_unary_or_binary_function_impl<R (__cdecl*)(...)>
|
||||
{ static const bool value = true; };
|
||||
|
||||
#endif
|
||||
*/
|
||||
|
||||
// see boost ticket #4094
|
||||
// avoid duplicate definitions of is_unary_or_binary_function_impl
|
||||
#ifndef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
|
||||
|
||||
template <typename R, class T0>
|
||||
struct is_unary_or_binary_function_impl<R (*)(T0)>
|
||||
{ static const bool value = true; };
|
||||
@@ -185,24 +182,16 @@ template <typename R, class T0>
|
||||
struct is_unary_or_binary_function_impl<R (*)(T0...)>
|
||||
{ static const bool value = true; };
|
||||
|
||||
#ifdef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
|
||||
#else // BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
|
||||
|
||||
template <typename R, class T0>
|
||||
struct is_unary_or_binary_function_impl<R (__stdcall*)(T0)>
|
||||
{ static const bool value = true; };
|
||||
/*
|
||||
template <typename R, class T0>
|
||||
struct is_unary_or_binary_function_impl<R (__stdcall*)(T0...)>
|
||||
{ static const bool value = true; };
|
||||
|
||||
template <typename R, class T0>
|
||||
struct is_unary_or_binary_function_impl<R (__fastcall*)(T0)>
|
||||
{ static const bool value = true; };
|
||||
|
||||
template <typename R, class T0>
|
||||
struct is_unary_or_binary_function_impl<R (__fastcall*)(T0...)>
|
||||
{ static const bool value = true; };
|
||||
|
||||
template <typename R, class T0>
|
||||
struct is_unary_or_binary_function_impl<R (__cdecl*)(T0)>
|
||||
{ static const bool value = true; };
|
||||
@@ -210,9 +199,13 @@ struct is_unary_or_binary_function_impl<R (__cdecl*)(T0)>
|
||||
template <typename R, class T0>
|
||||
struct is_unary_or_binary_function_impl<R (__cdecl*)(T0...)>
|
||||
{ static const bool value = true; };
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
// see boost ticket #4094
|
||||
// avoid duplicate definitions of is_unary_or_binary_function_impl
|
||||
#ifndef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
|
||||
|
||||
template <typename R, class T0, class T1>
|
||||
struct is_unary_or_binary_function_impl<R (*)(T0, T1)>
|
||||
{ static const bool value = true; };
|
||||
@@ -220,25 +213,17 @@ struct is_unary_or_binary_function_impl<R (*)(T0, T1)>
|
||||
template <typename R, class T0, class T1>
|
||||
struct is_unary_or_binary_function_impl<R (*)(T0, T1...)>
|
||||
{ static const bool value = true; };
|
||||
/*
|
||||
#ifdef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
|
||||
|
||||
#else // BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
|
||||
|
||||
template <typename R, class T0, class T1>
|
||||
struct is_unary_or_binary_function_impl<R (__stdcall*)(T0, T1)>
|
||||
{ static const bool value = true; };
|
||||
|
||||
template <typename R, class T0, class T1>
|
||||
struct is_unary_or_binary_function_impl<R (__stdcall*)(T0, T1...)>
|
||||
{ static const bool value = true; };
|
||||
|
||||
template <typename R, class T0, class T1>
|
||||
struct is_unary_or_binary_function_impl<R (__fastcall*)(T0, T1)>
|
||||
{ static const bool value = true; };
|
||||
|
||||
template <typename R, class T0, class T1>
|
||||
struct is_unary_or_binary_function_impl<R (__fastcall*)(T0, T1...)>
|
||||
{ static const bool value = true; };
|
||||
|
||||
template <typename R, class T0, class T1>
|
||||
struct is_unary_or_binary_function_impl<R (__cdecl*)(T0, T1)>
|
||||
{ static const bool value = true; };
|
||||
@@ -247,7 +232,7 @@ template <typename R, class T0, class T1>
|
||||
struct is_unary_or_binary_function_impl<R (__cdecl*)(T0, T1...)>
|
||||
{ static const bool value = true; };
|
||||
#endif
|
||||
*/
|
||||
|
||||
template <typename T>
|
||||
struct is_unary_or_binary_function_impl<T&>
|
||||
{ static const bool value = false; };
|
||||
|
||||
@@ -207,32 +207,33 @@ struct key_nodeptr_comp
|
||||
: private detail::ebo_functor_holder<KeyValueCompare>
|
||||
{
|
||||
typedef typename Container::real_value_traits real_value_traits;
|
||||
typedef typename Container::value_type value_type;
|
||||
typedef typename real_value_traits::node_ptr node_ptr;
|
||||
typedef typename real_value_traits::const_node_ptr const_node_ptr;
|
||||
typedef detail::ebo_functor_holder<KeyValueCompare> base_t;
|
||||
key_nodeptr_comp(KeyValueCompare kcomp, const Container *cont)
|
||||
: base_t(kcomp), cont_(cont)
|
||||
{}
|
||||
|
||||
template<class KeyType>
|
||||
bool operator()( const_node_ptr node, const KeyType &key
|
||||
, typename enable_if_c
|
||||
<!is_convertible<KeyType, const_node_ptr>::value>::type * = 0) const
|
||||
{ return base_t::get()(*cont_->get_real_value_traits().to_value_ptr(node), key); }
|
||||
|
||||
template<class KeyType>
|
||||
bool operator()(const KeyType &key, const_node_ptr node
|
||||
, typename enable_if_c
|
||||
<!is_convertible<KeyType, const_node_ptr>::value>::type * = 0) const
|
||||
{ return base_t::get()(key, *cont_->get_real_value_traits().to_value_ptr(node)); }
|
||||
|
||||
bool operator()(const_node_ptr node1, const_node_ptr node2) const
|
||||
|
||||
template<class T>
|
||||
struct is_node_ptr
|
||||
{
|
||||
return base_t::get()
|
||||
( *cont_->get_real_value_traits().to_value_ptr(node1)
|
||||
, *cont_->get_real_value_traits().to_value_ptr(node2)
|
||||
);
|
||||
}
|
||||
static const bool value = is_same<T, const_node_ptr>::value || is_same<T, node_ptr>::value;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
typename enable_if_c<is_node_ptr<T>::value, const value_type &>::type
|
||||
key_forward(const T &node) const
|
||||
{ return *cont_->get_real_value_traits().to_value_ptr(node); }
|
||||
|
||||
template<class T>
|
||||
typename enable_if_c<!is_node_ptr<T>::value, const T &>::type
|
||||
key_forward(const T &key) const
|
||||
{ return key;}
|
||||
|
||||
template<class KeyType, class KeyType2>
|
||||
bool operator()(const KeyType &key1, const KeyType2 &key2) const
|
||||
{ return base_t::get()(this->key_forward(key1), this->key_forward(key2)); }
|
||||
|
||||
const Container *cont_;
|
||||
};
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
#include <boost/intrusive/unordered_set_hook.hpp>
|
||||
#include <boost/intrusive/slist.hpp>
|
||||
#include <boost/intrusive/detail/mpl.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
@@ -123,7 +125,7 @@ struct get_slist_impl
|
||||
< typename NodeTraits::node
|
||||
, boost::intrusive::value_traits<trivial_traits>
|
||||
, boost::intrusive::constant_time_size<false>
|
||||
, boost::intrusive::size_type<std::size_t>
|
||||
, boost::intrusive::size_type<typename boost::make_unsigned<typename std::iterator_traits<typename NodeTraits::node_ptr>::difference_type>::type>
|
||||
>::type
|
||||
{};
|
||||
};
|
||||
@@ -211,7 +213,7 @@ struct optimize_multikey_is_true
|
||||
|
||||
template<class Config>
|
||||
struct bucket_plus_size
|
||||
: public detail::size_holder
|
||||
: public detail::size_holder //size_traits
|
||||
< 0 != (Config::bool_flags & hash_bool_flags::constant_time_size_pos)
|
||||
, typename Config::size_type>
|
||||
{
|
||||
@@ -220,15 +222,23 @@ struct bucket_plus_size
|
||||
, typename Config::size_type> size_traits;
|
||||
typedef typename Config::bucket_traits bucket_traits;
|
||||
|
||||
bucket_plus_size(const bucket_traits &b_traits)
|
||||
: bucket_traits_(b_traits)
|
||||
template<class BucketTraits>
|
||||
bucket_plus_size(BOOST_FWD_REF(BucketTraits) b_traits)
|
||||
: bucket_traits_(::boost::forward<BucketTraits>(b_traits))
|
||||
{}
|
||||
|
||||
bucket_plus_size & operator =(const bucket_plus_size &x)
|
||||
{
|
||||
this->size_traits::operator=(x);
|
||||
bucket_traits_ = x.bucket_traits_;
|
||||
return *this;
|
||||
}
|
||||
bucket_traits bucket_traits_;
|
||||
};
|
||||
|
||||
template<class Config>
|
||||
struct bucket_hash_t
|
||||
: public detail::ebo_functor_holder<typename Config::hash>
|
||||
: public detail::ebo_functor_holder<typename Config::hash> //hash
|
||||
{
|
||||
typedef typename Config::hash hasher;
|
||||
typedef detail::size_holder
|
||||
@@ -236,22 +246,26 @@ struct bucket_hash_t
|
||||
, typename Config::size_type> size_traits;
|
||||
typedef typename Config::bucket_traits bucket_traits;
|
||||
|
||||
bucket_hash_t(const bucket_traits &b_traits, const hasher & h)
|
||||
: detail::ebo_functor_holder<hasher>(h), bucket_plus_size_(b_traits)
|
||||
template<class BucketTraits>
|
||||
bucket_hash_t(BOOST_FWD_REF(BucketTraits) b_traits, const hasher & h)
|
||||
: detail::ebo_functor_holder<hasher>(h), bucket_plus_size_(::boost::forward<BucketTraits>(b_traits))
|
||||
{}
|
||||
|
||||
bucket_plus_size<Config> bucket_plus_size_;
|
||||
};
|
||||
|
||||
template<class Config, bool>
|
||||
struct bucket_hash_equal_t : public detail::ebo_functor_holder<typename Config::equal>
|
||||
struct bucket_hash_equal_t
|
||||
: public detail::ebo_functor_holder<typename Config::equal>
|
||||
{
|
||||
typedef typename Config::equal equal;
|
||||
typedef typename Config::hash hasher;
|
||||
typedef typename Config::bucket_traits bucket_traits;
|
||||
|
||||
bucket_hash_equal_t(const bucket_traits &b_traits, const hasher & h, const equal &e)
|
||||
: detail::ebo_functor_holder<typename Config::equal>(e), bucket_hash(b_traits, h)
|
||||
template<class BucketTraits>
|
||||
bucket_hash_equal_t(BOOST_FWD_REF(BucketTraits) b_traits, const hasher & h, const equal &e)
|
||||
: detail::ebo_functor_holder<typename Config::equal>(e)//equal()
|
||||
, bucket_hash(::boost::forward<BucketTraits>(b_traits), h)
|
||||
{}
|
||||
bucket_hash_t<Config> bucket_hash;
|
||||
};
|
||||
@@ -266,8 +280,10 @@ struct bucket_hash_equal_t<Config, true>
|
||||
typedef typename unordered_bucket_ptr_impl
|
||||
<typename Config::value_traits>::type bucket_ptr;
|
||||
|
||||
bucket_hash_equal_t(const bucket_traits &b_traits, const hasher & h, const equal &e)
|
||||
: detail::ebo_functor_holder<typename Config::equal>(e), bucket_hash(b_traits, h)
|
||||
template<class BucketTraits>
|
||||
bucket_hash_equal_t(BOOST_FWD_REF(BucketTraits) b_traits, const hasher & h, const equal &e)
|
||||
: detail::ebo_functor_holder<typename Config::equal>(e) //equal()
|
||||
, bucket_hash(::boost::forward<BucketTraits>(b_traits), h)
|
||||
{}
|
||||
bucket_hash_t<Config> bucket_hash;
|
||||
bucket_ptr cached_begin_;
|
||||
@@ -282,22 +298,25 @@ struct hashtable_data_t : public Config::value_traits
|
||||
typedef typename Config::hash hasher;
|
||||
typedef typename Config::bucket_traits bucket_traits;
|
||||
|
||||
hashtable_data_t( const bucket_traits &b_traits, const hasher & h
|
||||
template<class BucketTraits>
|
||||
hashtable_data_t( BOOST_FWD_REF(BucketTraits) b_traits, const hasher & h
|
||||
, const equal &e, const value_traits &val_traits)
|
||||
: Config::value_traits(val_traits), internal_(b_traits, h, e)
|
||||
: Config::value_traits(val_traits) //value_traits
|
||||
, internal_(::boost::forward<BucketTraits>(b_traits), h, e)
|
||||
{}
|
||||
typedef typename detail::usetopt_mask
|
||||
< Config
|
||||
, detail::hash_bool_flags::constant_time_size_pos
|
||||
| detail::hash_bool_flags::incremental_pos
|
||||
| detail::hash_bool_flags::incremental_pos
|
||||
>::type masked_config_t;
|
||||
struct internal
|
||||
: public detail::size_holder
|
||||
: public detail::size_holder //split_traits
|
||||
< 0 != (Config::bool_flags & hash_bool_flags::incremental_pos)
|
||||
, typename Config::size_type>
|
||||
{
|
||||
internal(const bucket_traits &b_traits, const hasher & h, const equal &e)
|
||||
: bucket_hash_equal_(b_traits, h, e)
|
||||
template<class BucketTraits>
|
||||
internal(BOOST_FWD_REF(BucketTraits) b_traits, const hasher & h, const equal &e)
|
||||
: bucket_hash_equal_(::boost::forward<BucketTraits>(b_traits), h, e)
|
||||
{}
|
||||
|
||||
bucket_hash_equal_t
|
||||
@@ -706,9 +725,8 @@ class hashtable_impl
|
||||
};
|
||||
|
||||
private:
|
||||
//noncopyable
|
||||
hashtable_impl (const hashtable_impl&);
|
||||
hashtable_impl operator =(const hashtable_impl&);
|
||||
//noncopyable, movable
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(hashtable_impl)
|
||||
|
||||
enum { safemode_or_autounlink =
|
||||
(int)real_value_traits::link_mode == (int)auto_unlink ||
|
||||
@@ -790,6 +808,33 @@ class hashtable_impl
|
||||
priv_split_traits().set_size(bucket_size>>1);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
hashtable_impl(BOOST_RV_REF(hashtable_impl) x)
|
||||
: data_( ::boost::move(x.priv_bucket_traits())
|
||||
, ::boost::move(x.priv_hasher())
|
||||
, ::boost::move(x.priv_equal())
|
||||
, ::boost::move(x.priv_value_traits())
|
||||
)
|
||||
{
|
||||
priv_swap_cache(cache_begin_t(), x);
|
||||
x.priv_initialize_cache();
|
||||
if(constant_time_size){
|
||||
this->priv_size_traits().set_size(size_type(0));
|
||||
this->priv_size_traits().set_size(x.priv_size_traits().get_size());
|
||||
x.priv_size_traits().set_size(size_type(0));
|
||||
}
|
||||
if(incremental){
|
||||
this->priv_split_traits().set_size(x.priv_split_traits().get_size());
|
||||
x.priv_split_traits().set_size(size_type(0));
|
||||
}
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
hashtable_impl& operator=(BOOST_RV_REF(hashtable_impl) x)
|
||||
{ this->swap(x); return *this; }
|
||||
|
||||
//! <b>Effects</b>: Detaches all elements from this. The objects in the unordered_set
|
||||
//! are not deleted (i.e. no destructors are called).
|
||||
//!
|
||||
@@ -934,14 +979,15 @@ class hashtable_impl
|
||||
swap(this->priv_equal(), other.priv_equal());
|
||||
swap(this->priv_hasher(), other.priv_hasher());
|
||||
//These can't throw
|
||||
swap(this->priv_real_bucket_traits(), other.priv_real_bucket_traits());
|
||||
swap(this->priv_bucket_traits(), other.priv_bucket_traits());
|
||||
swap(this->priv_value_traits(), other.priv_value_traits());
|
||||
priv_swap_cache(cache_begin_t(), other);
|
||||
if(constant_time_size){
|
||||
size_type backup = this->priv_size_traits().get_size();
|
||||
this->priv_size_traits().set_size(other.priv_size_traits().get_size());
|
||||
other.priv_size_traits().set_size(backup);
|
||||
}
|
||||
else if(incremental){
|
||||
if(incremental){
|
||||
size_type backup = this->priv_split_traits().get_size();
|
||||
this->priv_split_traits().set_size(other.priv_split_traits().get_size());
|
||||
other.priv_split_traits().set_size(backup);
|
||||
@@ -1677,7 +1723,8 @@ class hashtable_impl
|
||||
//! <b>Throws</b>: If the internal hash function throws.
|
||||
const_iterator iterator_to(const_reference value) const
|
||||
{
|
||||
return const_iterator(bucket_type::s_iterator_to(priv_value_to_node(const_cast<reference>(value))), this);
|
||||
siterator sit = bucket_type::s_iterator_to(const_cast<node &>(this->priv_value_to_node(value)));
|
||||
return const_iterator(sit, this);
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
|
||||
@@ -2147,7 +2194,7 @@ class hashtable_impl
|
||||
{
|
||||
const std::size_t *primes = &detail::prime_list_holder<0>::prime_list[0];
|
||||
const std::size_t *primes_end = primes + detail::prime_list_holder<0>::prime_list_size;
|
||||
size_type const* bound = std::lower_bound(primes, primes_end, n);
|
||||
std::size_t const* bound = std::lower_bound(primes, primes_end, n);
|
||||
if(bound == primes_end)
|
||||
--bound;
|
||||
return size_type(*bound);
|
||||
@@ -2199,6 +2246,12 @@ class hashtable_impl
|
||||
key_equal &priv_equal()
|
||||
{ return static_cast<key_equal&>(this->data_.internal_.bucket_hash_equal_.get()); }
|
||||
|
||||
const value_traits &priv_value_traits() const
|
||||
{ return data_; }
|
||||
|
||||
value_traits &priv_value_traits()
|
||||
{ return data_; }
|
||||
|
||||
value_type &priv_value_from_slist_node(slist_node_ptr n)
|
||||
{ return *this->get_real_value_traits().to_value_ptr(dcast_bucket_ptr(n)); }
|
||||
|
||||
@@ -2223,6 +2276,12 @@ class hashtable_impl
|
||||
real_bucket_traits &priv_real_bucket_traits()
|
||||
{ return this->priv_real_bucket_traits(detail::bool_<external_bucket_traits>()); }
|
||||
|
||||
const bucket_traits &priv_bucket_traits() const
|
||||
{ return this->data_.internal_.bucket_hash_equal_.bucket_hash.bucket_plus_size_.bucket_traits_; }
|
||||
|
||||
bucket_traits &priv_bucket_traits()
|
||||
{ return this->data_.internal_.bucket_hash_equal_.bucket_hash.bucket_plus_size_.bucket_traits_; }
|
||||
|
||||
const hasher &priv_hasher() const
|
||||
{ return static_cast<const hasher&>(this->data_.internal_.bucket_hash_equal_.bucket_hash.get()); }
|
||||
|
||||
@@ -2987,6 +3046,7 @@ class hashtable
|
||||
Options...
|
||||
#endif
|
||||
>::type Base;
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(hashtable)
|
||||
|
||||
public:
|
||||
typedef typename Base::value_traits value_traits;
|
||||
@@ -3008,6 +3068,13 @@ class hashtable
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(b_traits, hash_func, equal_func, v_traits)
|
||||
{}
|
||||
|
||||
hashtable(BOOST_RV_REF(hashtable) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
hashtable& operator=(BOOST_RV_REF(hashtable) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <cstddef>
|
||||
//iG pending #include <boost/pointer_cast.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
@@ -114,9 +114,8 @@ class list_impl
|
||||
private:
|
||||
typedef detail::size_holder<constant_time_size, size_type> size_traits;
|
||||
|
||||
//Non-copyable and non-moveable
|
||||
list_impl (const list_impl&);
|
||||
list_impl &operator =(const list_impl&);
|
||||
//noncopyable
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(list_impl)
|
||||
|
||||
enum { safemode_or_autounlink =
|
||||
(int)real_value_traits::link_mode == (int)auto_unlink ||
|
||||
@@ -173,10 +172,10 @@ class list_impl
|
||||
real_value_traits &get_real_value_traits(detail::bool_<true>)
|
||||
{ return data_.get_value_traits(*this); }
|
||||
|
||||
const value_traits &get_value_traits() const
|
||||
const value_traits &priv_value_traits() const
|
||||
{ return data_; }
|
||||
|
||||
value_traits &get_value_traits()
|
||||
value_traits &priv_value_traits()
|
||||
{ return data_; }
|
||||
|
||||
protected:
|
||||
@@ -229,6 +228,21 @@ class list_impl
|
||||
this->insert(this->cend(), b, e);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
list_impl(BOOST_RV_REF(list_impl) x)
|
||||
: data_(::boost::move(x.priv_value_traits()))
|
||||
{
|
||||
this->priv_size_traits().set_size(size_type(0));
|
||||
node_algorithms::init_header(this->get_root_node());
|
||||
this->swap(x);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
list_impl& operator=(BOOST_RV_REF(list_impl) x)
|
||||
{ this->swap(x); return *this; }
|
||||
|
||||
//! <b>Effects</b>: If it's not a safe-mode or an auto-unlink value_type
|
||||
//! the destructor does nothing
|
||||
//! (ie. no code is generated). Otherwise it detaches all elements from this.
|
||||
@@ -988,8 +1002,8 @@ class list_impl
|
||||
{
|
||||
if(node_traits::get_next(this->get_root_node())
|
||||
!= node_traits::get_previous(this->get_root_node())){
|
||||
list_impl carry(this->get_value_traits());
|
||||
detail::array_initializer<list_impl, 64> counter(this->get_value_traits());
|
||||
list_impl carry(this->priv_value_traits());
|
||||
detail::array_initializer<list_impl, 64> counter(this->priv_value_traits());
|
||||
int fill = 0;
|
||||
while(!this->empty()){
|
||||
carry.splice(carry.cbegin(), *this, this->cbegin());
|
||||
@@ -1473,6 +1487,8 @@ class list
|
||||
typedef typename Base::real_value_traits real_value_traits;
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename real_value_traits::value_type, T>::value));
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(list)
|
||||
|
||||
public:
|
||||
typedef typename Base::value_traits value_traits;
|
||||
typedef typename Base::iterator iterator;
|
||||
@@ -1487,6 +1503,13 @@ class list
|
||||
: Base(b, e, v_traits)
|
||||
{}
|
||||
|
||||
list(BOOST_RV_REF(list) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
list& operator=(BOOST_RV_REF(list) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
|
||||
static list &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<list &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
|
||||
@@ -775,7 +775,7 @@ template<class Prev, class ...Others>
|
||||
struct do_pack<typelist<Prev, Others...> >
|
||||
{
|
||||
typedef typename Prev::template pack
|
||||
<typename do_pack<typelist<Others...>>::type> type;
|
||||
<typename do_pack<typelist<Others...> >::type> type;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <boost/intrusive/options.hpp>
|
||||
#include <boost/intrusive/rbtree_algorithms.hpp>
|
||||
#include <boost/intrusive/link_mode.hpp>
|
||||
//iG pending #include <boost/pointer_cast.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
@@ -122,8 +122,7 @@ class rbtree_impl
|
||||
typedef detail::size_holder<constant_time_size, size_type> size_traits;
|
||||
|
||||
//noncopyable
|
||||
rbtree_impl (const rbtree_impl&);
|
||||
rbtree_impl operator =(const rbtree_impl&);
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(rbtree_impl)
|
||||
|
||||
enum { safemode_or_autounlink =
|
||||
(int)real_value_traits::link_mode == (int)auto_unlink ||
|
||||
@@ -158,6 +157,12 @@ class rbtree_impl
|
||||
value_compare &priv_comp()
|
||||
{ return data_.node_plus_pred_.get(); }
|
||||
|
||||
const value_traits &priv_value_traits() const
|
||||
{ return data_; }
|
||||
|
||||
value_traits &priv_value_traits()
|
||||
{ return data_; }
|
||||
|
||||
const node &priv_header() const
|
||||
{ return data_.node_plus_pred_.header_plus_size_.header_; }
|
||||
|
||||
@@ -254,6 +259,21 @@ class rbtree_impl
|
||||
this->insert_equal(b, e);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
rbtree_impl(BOOST_RV_REF(rbtree_impl) x)
|
||||
: data_(::boost::move(x.priv_comp()), ::boost::move(x.priv_value_traits()))
|
||||
{
|
||||
node_algorithms::init_header(&priv_header());
|
||||
this->priv_size_traits().set_size(size_type(0));
|
||||
this->swap(x);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
rbtree_impl& operator=(BOOST_RV_REF(rbtree_impl) x)
|
||||
{ this->swap(x); return *this; }
|
||||
|
||||
//! <b>Effects</b>: Detaches all elements from this. The objects in the set
|
||||
//! are not deleted (i.e. no destructors are called), but the nodes according to
|
||||
//! the value_traits template parameter are reinitialized and thus can be reused.
|
||||
@@ -1286,6 +1306,8 @@ class rbtree_impl
|
||||
node_algorithms::replace_node( get_real_value_traits().to_node_ptr(*replace_this)
|
||||
, node_ptr(&priv_header())
|
||||
, get_real_value_traits().to_node_ptr(with_this));
|
||||
if(safemode_or_autounlink)
|
||||
node_algorithms::init(replace_this.pointed_node());
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
|
||||
@@ -1611,6 +1633,7 @@ class rbtree
|
||||
Options...
|
||||
#endif
|
||||
>::type Base;
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(rbtree)
|
||||
|
||||
public:
|
||||
typedef typename Base::value_compare value_compare;
|
||||
@@ -1634,6 +1657,13 @@ class rbtree
|
||||
: Base(unique, b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
rbtree(BOOST_RV_REF(rbtree) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
rbtree& operator=(BOOST_RV_REF(rbtree) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
|
||||
static rbtree &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<rbtree &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <boost/intrusive/detail/mpl.hpp>
|
||||
#include <boost/intrusive/rbtree.hpp>
|
||||
#include <iterator>
|
||||
#include <boost/move/move.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
@@ -42,13 +43,7 @@ class set_impl
|
||||
{
|
||||
/// @cond
|
||||
typedef rbtree_impl<Config> tree_type;
|
||||
//! This class is
|
||||
//! non-copyable
|
||||
set_impl (const set_impl&);
|
||||
|
||||
//! This class is
|
||||
//! non-assignable
|
||||
set_impl &operator =(const set_impl&);
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(set_impl)
|
||||
|
||||
typedef tree_type implementation_defined;
|
||||
/// @endcond
|
||||
@@ -122,6 +117,17 @@ class set_impl
|
||||
: tree_(true, b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
set_impl(BOOST_RV_REF(set_impl) x)
|
||||
: tree_(::boost::move(x.tree_))
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
set_impl& operator=(BOOST_RV_REF(set_impl) x)
|
||||
{ tree_ = ::boost::move(x.tree_); return *this; }
|
||||
|
||||
//! <b>Effects</b>: Detaches all elements from this. The objects in the set
|
||||
//! are not deleted (i.e. no destructors are called).
|
||||
//!
|
||||
@@ -1190,6 +1196,7 @@ class set
|
||||
#endif
|
||||
>::type Base;
|
||||
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(set)
|
||||
public:
|
||||
typedef typename Base::value_compare value_compare;
|
||||
typedef typename Base::value_traits value_traits;
|
||||
@@ -1211,6 +1218,13 @@ class set
|
||||
: Base(b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
set(BOOST_RV_REF(set) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
set& operator=(BOOST_RV_REF(set) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
|
||||
static set &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<set &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
@@ -1247,9 +1261,7 @@ class multiset_impl
|
||||
/// @cond
|
||||
typedef rbtree_impl<Config> tree_type;
|
||||
|
||||
//Non-copyable and non-assignable
|
||||
multiset_impl (const multiset_impl&);
|
||||
multiset_impl &operator =(const multiset_impl&);
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(multiset_impl)
|
||||
typedef tree_type implementation_defined;
|
||||
/// @endcond
|
||||
|
||||
@@ -1321,6 +1333,17 @@ class multiset_impl
|
||||
: tree_(false, b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
multiset_impl(BOOST_RV_REF(multiset_impl) x)
|
||||
: tree_(::boost::move(x.tree_))
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
multiset_impl& operator=(BOOST_RV_REF(multiset_impl) x)
|
||||
{ tree_ = ::boost::move(x.tree_); return *this; }
|
||||
|
||||
//! <b>Effects</b>: Detaches all elements from this. The objects in the set
|
||||
//! are not deleted (i.e. no destructors are called).
|
||||
//!
|
||||
@@ -2307,6 +2330,8 @@ class multiset
|
||||
Options...
|
||||
#endif
|
||||
>::type Base;
|
||||
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(multiset)
|
||||
|
||||
public:
|
||||
typedef typename Base::value_compare value_compare;
|
||||
@@ -2329,6 +2354,13 @@ class multiset
|
||||
: Base(b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
multiset(BOOST_RV_REF(multiset) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
multiset& operator=(BOOST_RV_REF(multiset) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
|
||||
static multiset &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/intrusive/sgtree.hpp>
|
||||
#include <boost/intrusive/detail/mpl.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
#include <iterator>
|
||||
|
||||
namespace boost {
|
||||
@@ -42,12 +43,8 @@ class sg_set_impl
|
||||
/// @cond
|
||||
typedef sgtree_impl<Config> tree_type;
|
||||
//! This class is
|
||||
//! non-copyable
|
||||
sg_set_impl (const sg_set_impl&);
|
||||
|
||||
//! This class is
|
||||
//! non-assignable
|
||||
sg_set_impl &operator =(const sg_set_impl&);
|
||||
//! movable
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(sg_set_impl)
|
||||
|
||||
typedef tree_type implementation_defined;
|
||||
/// @endcond
|
||||
@@ -111,6 +108,17 @@ class sg_set_impl
|
||||
: tree_(true, b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
sg_set_impl(BOOST_RV_REF(sg_set_impl) x)
|
||||
: tree_(::boost::move(x.tree_))
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
sg_set_impl& operator=(BOOST_RV_REF(sg_set_impl) x)
|
||||
{ tree_ = ::boost::move(x.tree_); return *this; }
|
||||
|
||||
//! <b>Effects</b>: Detaches all elements from this. The objects in the sg_set
|
||||
//! are not deleted (i.e. no destructors are called).
|
||||
//!
|
||||
@@ -1218,6 +1226,7 @@ class sg_set
|
||||
Options...
|
||||
#endif
|
||||
>::type Base;
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(sg_set)
|
||||
|
||||
public:
|
||||
typedef typename Base::value_compare value_compare;
|
||||
@@ -1240,6 +1249,13 @@ class sg_set
|
||||
: Base(b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
sg_set(BOOST_RV_REF(sg_set) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
sg_set& operator=(BOOST_RV_REF(sg_set) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
|
||||
static sg_set &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<sg_set &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
@@ -1277,8 +1293,7 @@ class sg_multiset_impl
|
||||
typedef sgtree_impl<Config> tree_type;
|
||||
|
||||
//Non-copyable and non-assignable
|
||||
sg_multiset_impl (const sg_multiset_impl&);
|
||||
sg_multiset_impl &operator =(const sg_multiset_impl&);
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(sg_multiset_impl)
|
||||
typedef tree_type implementation_defined;
|
||||
/// @endcond
|
||||
|
||||
@@ -1341,6 +1356,17 @@ class sg_multiset_impl
|
||||
: tree_(false, b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
sg_multiset_impl(BOOST_RV_REF(sg_multiset_impl) x)
|
||||
: tree_(::boost::move(x.tree_))
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
sg_multiset_impl& operator=(BOOST_RV_REF(sg_multiset_impl) x)
|
||||
{ tree_ = ::boost::move(x.tree_); return *this; }
|
||||
|
||||
//! <b>Effects</b>: Detaches all elements from this. The objects in the sg_multiset
|
||||
//! are not deleted (i.e. no destructors are called).
|
||||
//!
|
||||
@@ -2352,6 +2378,7 @@ class sg_multiset
|
||||
Options...
|
||||
#endif
|
||||
>::type Base;
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(sg_multiset)
|
||||
|
||||
public:
|
||||
typedef typename Base::value_compare value_compare;
|
||||
@@ -2374,6 +2401,13 @@ class sg_multiset
|
||||
: Base(b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
sg_multiset(BOOST_RV_REF(sg_multiset) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
sg_multiset& operator=(BOOST_RV_REF(sg_multiset) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
|
||||
static sg_multiset &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<sg_multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <boost/intrusive/options.hpp>
|
||||
#include <boost/intrusive/sgtree_algorithms.hpp>
|
||||
#include <boost/intrusive/link_mode.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
@@ -254,8 +255,7 @@ class sgtree_impl
|
||||
typedef typename alpha_traits::multiply_by_alpha_t multiply_by_alpha_t;
|
||||
|
||||
//noncopyable
|
||||
sgtree_impl (const sgtree_impl&);
|
||||
sgtree_impl operator =(const sgtree_impl&);
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(sgtree_impl)
|
||||
|
||||
enum { safemode_or_autounlink =
|
||||
(int)real_value_traits::link_mode == (int)auto_unlink ||
|
||||
@@ -303,6 +303,12 @@ class sgtree_impl
|
||||
value_compare &priv_comp()
|
||||
{ return data_.node_plus_pred_.get(); }
|
||||
|
||||
const value_traits &priv_value_traits() const
|
||||
{ return data_; }
|
||||
|
||||
value_traits &priv_value_traits()
|
||||
{ return data_; }
|
||||
|
||||
const node &priv_header() const
|
||||
{ return data_.node_plus_pred_.header_plus_alpha_.header_; }
|
||||
|
||||
@@ -395,6 +401,21 @@ class sgtree_impl
|
||||
this->insert_equal(b, e);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
sgtree_impl(BOOST_RV_REF(sgtree_impl) x)
|
||||
: data_(::boost::move(x.priv_comp()), ::boost::move(x.priv_value_traits()))
|
||||
{
|
||||
node_algorithms::init_header(&priv_header());
|
||||
this->priv_size_traits().set_size(size_type(0));
|
||||
this->swap(x);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
sgtree_impl& operator=(BOOST_RV_REF(sgtree_impl) x)
|
||||
{ this->swap(x); return *this; }
|
||||
|
||||
//! <b>Effects</b>: Detaches all elements from this. The objects in the set
|
||||
//! are not deleted (i.e. no destructors are called), but the nodes according to
|
||||
//! the value_traits template parameter are reinitialized and thus can be reused.
|
||||
@@ -1453,6 +1474,8 @@ class sgtree_impl
|
||||
node_algorithms::replace_node( get_real_value_traits().to_node_ptr(*replace_this)
|
||||
, node_ptr(&priv_header())
|
||||
, get_real_value_traits().to_node_ptr(with_this));
|
||||
if(safemode_or_autounlink)
|
||||
node_algorithms::init(replace_this.pointed_node());
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
|
||||
@@ -1836,6 +1859,8 @@ class sgtree
|
||||
#endif
|
||||
>::type Base;
|
||||
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(sgtree)
|
||||
|
||||
public:
|
||||
typedef typename Base::value_compare value_compare;
|
||||
typedef typename Base::value_traits value_traits;
|
||||
@@ -1858,6 +1883,13 @@ class sgtree
|
||||
: Base(unique, b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
sgtree(BOOST_RV_REF(sgtree) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
sgtree& operator=(BOOST_RV_REF(sgtree) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
|
||||
static sgtree &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<sgtree &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <algorithm>
|
||||
#include <cstddef> //std::size_t
|
||||
#include <utility> //std::pair
|
||||
//iG pending #include <boost/pointer_cast.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
@@ -148,13 +148,8 @@ class slist_impl
|
||||
private:
|
||||
typedef detail::size_holder<constant_time_size, size_type> size_traits;
|
||||
|
||||
//! This class is
|
||||
//! non-copyable
|
||||
slist_impl (const slist_impl&);
|
||||
|
||||
//! This class is
|
||||
//! non-asignable
|
||||
slist_impl &operator =(const slist_impl&);
|
||||
//noncopyable
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(slist_impl)
|
||||
|
||||
enum { safemode_or_autounlink =
|
||||
(int)real_value_traits::link_mode == (int)auto_unlink ||
|
||||
@@ -252,10 +247,10 @@ class slist_impl
|
||||
real_value_traits &get_real_value_traits(detail::bool_<true>)
|
||||
{ return data_.get_value_traits(*this); }
|
||||
|
||||
const value_traits &get_value_traits() const
|
||||
const value_traits &priv_value_traits() const
|
||||
{ return data_; }
|
||||
|
||||
value_traits &get_value_traits()
|
||||
value_traits &priv_value_traits()
|
||||
{ return data_; }
|
||||
|
||||
protected:
|
||||
@@ -305,6 +300,21 @@ class slist_impl
|
||||
this->insert_after(this->cbefore_begin(), b, e);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
slist_impl(BOOST_RV_REF(slist_impl) x)
|
||||
: data_(::boost::move(x.priv_value_traits()))
|
||||
{
|
||||
this->priv_size_traits().set_size(size_type(0));
|
||||
node_algorithms::init_header(this->get_root_node());
|
||||
this->swap(x);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
slist_impl& operator=(BOOST_RV_REF(slist_impl) x)
|
||||
{ this->swap(x); return *this; }
|
||||
|
||||
//! <b>Effects</b>: If it's a safe-mode
|
||||
//! or auto-unlink value, the destructor does nothing
|
||||
//! (ie. no code is generated). Otherwise it detaches all elements from this.
|
||||
@@ -1313,8 +1323,8 @@ class slist_impl
|
||||
if (node_traits::get_next(node_traits::get_next(this->get_root_node()))
|
||||
!= this->get_root_node()) {
|
||||
|
||||
slist_impl carry(this->get_value_traits());
|
||||
detail::array_initializer<slist_impl, 64> counter(this->get_value_traits());
|
||||
slist_impl carry(this->priv_value_traits());
|
||||
detail::array_initializer<slist_impl, 64> counter(this->priv_value_traits());
|
||||
int fill = 0;
|
||||
const_iterator last_inserted;
|
||||
while(!this->empty()){
|
||||
@@ -2084,6 +2094,8 @@ class slist
|
||||
typedef typename Base::real_value_traits real_value_traits;
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename real_value_traits::value_type, T>::value));
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(slist)
|
||||
|
||||
public:
|
||||
typedef typename Base::value_traits value_traits;
|
||||
typedef typename Base::iterator iterator;
|
||||
@@ -2098,6 +2110,13 @@ class slist
|
||||
: Base(b, e, v_traits)
|
||||
{}
|
||||
|
||||
slist(BOOST_RV_REF(slist) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
slist& operator=(BOOST_RV_REF(slist) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
|
||||
static slist &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<slist &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/intrusive/splaytree.hpp>
|
||||
#include <boost/intrusive/detail/mpl.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
#include <iterator>
|
||||
|
||||
namespace boost {
|
||||
@@ -42,12 +43,8 @@ class splay_set_impl
|
||||
/// @cond
|
||||
typedef splaytree_impl<Config> tree_type;
|
||||
//! This class is
|
||||
//! non-copyable
|
||||
splay_set_impl (const splay_set_impl&);
|
||||
|
||||
//! This class is
|
||||
//! non-assignable
|
||||
splay_set_impl &operator =(const splay_set_impl&);
|
||||
//! movable
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(splay_set_impl)
|
||||
|
||||
typedef tree_type implementation_defined;
|
||||
/// @endcond
|
||||
@@ -113,6 +110,17 @@ class splay_set_impl
|
||||
: tree_(true, b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
splay_set_impl(BOOST_RV_REF(splay_set_impl) x)
|
||||
: tree_(::boost::move(x.tree_))
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
splay_set_impl& operator=(BOOST_RV_REF(splay_set_impl) x)
|
||||
{ tree_ = ::boost::move(x.tree_); return *this; }
|
||||
|
||||
//! <b>Effects</b>: Detaches all elements from this. The objects in the splay_set
|
||||
//! are not deleted (i.e. no destructors are called).
|
||||
//!
|
||||
@@ -1202,6 +1210,7 @@ class splay_set
|
||||
Options...
|
||||
#endif
|
||||
>::type Base;
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(splay_set)
|
||||
|
||||
public:
|
||||
typedef typename Base::value_compare value_compare;
|
||||
@@ -1224,6 +1233,13 @@ class splay_set
|
||||
: Base(b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
splay_set(BOOST_RV_REF(splay_set) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
splay_set& operator=(BOOST_RV_REF(splay_set) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
|
||||
static splay_set &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<splay_set &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
@@ -1260,9 +1276,8 @@ class splay_multiset_impl
|
||||
/// @cond
|
||||
typedef splaytree_impl<Config> tree_type;
|
||||
|
||||
//Non-copyable and non-assignable
|
||||
splay_multiset_impl (const splay_multiset_impl&);
|
||||
splay_multiset_impl &operator =(const splay_multiset_impl&);
|
||||
//Movable
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(splay_multiset_impl)
|
||||
typedef tree_type implementation_defined;
|
||||
/// @endcond
|
||||
|
||||
@@ -1327,6 +1342,17 @@ class splay_multiset_impl
|
||||
: tree_(false, b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
splay_multiset_impl(BOOST_RV_REF(splay_multiset_impl) x)
|
||||
: tree_(::boost::move(x.tree_))
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
splay_multiset_impl& operator=(BOOST_RV_REF(splay_multiset_impl) x)
|
||||
{ tree_ = ::boost::move(x.tree_); return *this; }
|
||||
|
||||
//! <b>Effects</b>: Detaches all elements from this. The objects in the set
|
||||
//! are not deleted (i.e. no destructors are called).
|
||||
//!
|
||||
@@ -2324,6 +2350,7 @@ class splay_multiset
|
||||
Options...
|
||||
#endif
|
||||
>::type Base;
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(splay_multiset)
|
||||
|
||||
public:
|
||||
typedef typename Base::value_compare value_compare;
|
||||
@@ -2346,6 +2373,13 @@ class splay_multiset
|
||||
: Base(b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
splay_multiset(BOOST_RV_REF(splay_multiset) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
splay_multiset& operator=(BOOST_RV_REF(splay_multiset) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
|
||||
static splay_multiset &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<splay_multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <boost/intrusive/options.hpp>
|
||||
#include <boost/intrusive/splaytree_algorithms.hpp>
|
||||
#include <boost/intrusive/link_mode.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
|
||||
|
||||
namespace boost {
|
||||
@@ -122,8 +123,7 @@ class splaytree_impl
|
||||
typedef detail::size_holder<constant_time_size, size_type> size_traits;
|
||||
|
||||
//noncopyable
|
||||
splaytree_impl (const splaytree_impl&);
|
||||
splaytree_impl operator =(const splaytree_impl&);
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(splaytree_impl)
|
||||
|
||||
enum { safemode_or_autounlink =
|
||||
(int)real_value_traits::link_mode == (int)auto_unlink ||
|
||||
@@ -158,6 +158,12 @@ class splaytree_impl
|
||||
value_compare &priv_comp()
|
||||
{ return data_.node_plus_pred_.get(); }
|
||||
|
||||
const value_traits &priv_value_traits() const
|
||||
{ return data_; }
|
||||
|
||||
value_traits &priv_value_traits()
|
||||
{ return data_; }
|
||||
|
||||
const node &priv_header() const
|
||||
{ return data_.node_plus_pred_.header_plus_size_.header_; }
|
||||
|
||||
@@ -240,6 +246,21 @@ class splaytree_impl
|
||||
this->insert_equal(b, e);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
splaytree_impl(BOOST_RV_REF(splaytree_impl) x)
|
||||
: data_(::boost::move(x.priv_comp()), ::boost::move(x.priv_value_traits()))
|
||||
{
|
||||
node_algorithms::init_header(&priv_header());
|
||||
this->priv_size_traits().set_size(size_type(0));
|
||||
this->swap(x);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
splaytree_impl& operator=(BOOST_RV_REF(splaytree_impl) x)
|
||||
{ this->swap(x); return *this; }
|
||||
|
||||
//! <b>Effects</b>: Detaches all elements from this. The objects in the set
|
||||
//! are not deleted (i.e. no destructors are called), but the nodes according to
|
||||
//! the value_traits template parameter are reinitialized and thus can be reused.
|
||||
@@ -1261,6 +1282,8 @@ class splaytree_impl
|
||||
node_algorithms::replace_node( get_real_value_traits().to_node_ptr(*replace_this)
|
||||
, node_ptr(&priv_header())
|
||||
, get_real_value_traits().to_node_ptr(with_this));
|
||||
if(safemode_or_autounlink)
|
||||
node_algorithms::init(replace_this.pointed_node());
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
|
||||
@@ -1612,6 +1635,7 @@ class splaytree
|
||||
Options...
|
||||
#endif
|
||||
>::type Base;
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(splaytree)
|
||||
|
||||
public:
|
||||
typedef typename Base::value_compare value_compare;
|
||||
@@ -1635,6 +1659,13 @@ class splaytree
|
||||
: Base(unique, b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
splaytree(BOOST_RV_REF(splaytree) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
splaytree& operator=(BOOST_RV_REF(splaytree) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
|
||||
static splaytree &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<splaytree &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <boost/intrusive/detail/mpl.hpp>
|
||||
#include <boost/intrusive/treap_algorithms.hpp>
|
||||
#include <boost/intrusive/link_mode.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
#include <boost/intrusive/priority_compare.hpp>
|
||||
|
||||
namespace boost {
|
||||
@@ -126,8 +127,7 @@ class treap_impl
|
||||
typedef detail::size_holder<constant_time_size, size_type> size_traits;
|
||||
|
||||
//noncopyable
|
||||
treap_impl (const treap_impl&);
|
||||
treap_impl operator =(const treap_impl&);
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(treap_impl)
|
||||
|
||||
enum { safemode_or_autounlink =
|
||||
(int)real_value_traits::link_mode == (int)auto_unlink ||
|
||||
@@ -176,6 +176,12 @@ class treap_impl
|
||||
priority_compare &priv_pcomp()
|
||||
{ return data_.node_plus_pred_.header_plus_priority_size_.get(); }
|
||||
|
||||
const value_traits &priv_value_traits() const
|
||||
{ return data_; }
|
||||
|
||||
value_traits &priv_value_traits()
|
||||
{ return data_; }
|
||||
|
||||
const node &priv_header() const
|
||||
{ return data_.node_plus_pred_.header_plus_priority_size_.header_plus_size_.header_; }
|
||||
|
||||
@@ -224,7 +230,7 @@ class treap_impl
|
||||
//! <b>Throws</b>: If value_traits::node_traits::node
|
||||
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
|
||||
//! or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee.
|
||||
treap_impl( const value_compare &cmp = value_compare()
|
||||
treap_impl( const value_compare &cmp = value_compare()
|
||||
, const priority_compare &pcmp = priority_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: data_(cmp, pcmp, v_traits)
|
||||
@@ -261,6 +267,23 @@ class treap_impl
|
||||
this->insert_equal(b, e);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
treap_impl(BOOST_RV_REF(treap_impl) x)
|
||||
: data_( ::boost::move(x.priv_comp())
|
||||
, ::boost::move(x.priv_pcomp())
|
||||
, ::boost::move(x.priv_value_traits()))
|
||||
{
|
||||
node_algorithms::init_header(&priv_header());
|
||||
this->priv_size_traits().set_size(size_type(0));
|
||||
this->swap(x);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
treap_impl& operator=(BOOST_RV_REF(treap_impl) x)
|
||||
{ this->swap(x); return *this; }
|
||||
|
||||
//! <b>Effects</b>: Detaches all elements from this. The objects in the set
|
||||
//! are not deleted (i.e. no destructors are called), but the nodes according to
|
||||
//! the value_traits template parameter are reinitialized and thus can be reused.
|
||||
@@ -1387,6 +1410,8 @@ class treap_impl
|
||||
node_algorithms::replace_node( get_real_value_traits().to_node_ptr(*replace_this)
|
||||
, node_ptr(&priv_header())
|
||||
, get_real_value_traits().to_node_ptr(with_this));
|
||||
if(safemode_or_autounlink)
|
||||
node_algorithms::init(replace_this.pointed_node());
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
|
||||
@@ -1699,6 +1724,7 @@ class treap
|
||||
Options...
|
||||
#endif
|
||||
>::type Base;
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(treap)
|
||||
|
||||
public:
|
||||
typedef typename Base::value_compare value_compare;
|
||||
@@ -1725,6 +1751,13 @@ class treap
|
||||
: Base(unique, b, e, cmp, pcmp, v_traits)
|
||||
{}
|
||||
|
||||
treap(BOOST_RV_REF(treap) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
treap& operator=(BOOST_RV_REF(treap) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
|
||||
static treap &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<treap &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/intrusive/treap.hpp>
|
||||
#include <boost/intrusive/detail/mpl.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
#include <iterator>
|
||||
|
||||
namespace boost {
|
||||
@@ -42,12 +43,8 @@ class treap_set_impl
|
||||
/// @cond
|
||||
typedef treap_impl<Config> tree_type;
|
||||
//! This class is
|
||||
//! non-copyable
|
||||
treap_set_impl (const treap_set_impl&);
|
||||
|
||||
//! This class is
|
||||
//! non-assignable
|
||||
treap_set_impl &operator =(const treap_set_impl&);
|
||||
//! movable
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(treap_set_impl)
|
||||
|
||||
typedef tree_type implementation_defined;
|
||||
/// @endcond
|
||||
@@ -116,6 +113,17 @@ class treap_set_impl
|
||||
: tree_(true, b, e, cmp, pcmp, v_traits)
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
treap_set_impl(BOOST_RV_REF(treap_set_impl) x)
|
||||
: tree_(::boost::move(x.tree_))
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
treap_set_impl& operator=(BOOST_RV_REF(treap_set_impl) x)
|
||||
{ tree_ = ::boost::move(x.tree_); return *this; }
|
||||
|
||||
//! <b>Effects</b>: Detaches all elements from this. The objects in the treap_set
|
||||
//! are not deleted (i.e. no destructors are called).
|
||||
//!
|
||||
@@ -1294,6 +1302,7 @@ class treap_set
|
||||
Options...
|
||||
#endif
|
||||
>::type Base;
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(treap_set)
|
||||
|
||||
public:
|
||||
typedef typename Base::value_compare value_compare;
|
||||
@@ -1319,6 +1328,13 @@ class treap_set
|
||||
: Base(b, e, cmp, pcmp, v_traits)
|
||||
{}
|
||||
|
||||
treap_set(BOOST_RV_REF(treap_set) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
treap_set& operator=(BOOST_RV_REF(treap_set) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
|
||||
static treap_set &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<treap_set &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
@@ -1355,9 +1371,7 @@ class treap_multiset_impl
|
||||
/// @cond
|
||||
typedef treap_impl<Config> tree_type;
|
||||
|
||||
//Non-copyable and non-assignable
|
||||
treap_multiset_impl (const treap_multiset_impl&);
|
||||
treap_multiset_impl &operator =(const treap_multiset_impl&);
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(treap_multiset_impl)
|
||||
typedef tree_type implementation_defined;
|
||||
/// @endcond
|
||||
|
||||
@@ -1425,6 +1439,17 @@ class treap_multiset_impl
|
||||
: tree_(false, b, e, cmp, pcmp, v_traits)
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
treap_multiset_impl(BOOST_RV_REF(treap_multiset_impl) x)
|
||||
: tree_(::boost::move(x.tree_))
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
treap_multiset_impl& operator=(BOOST_RV_REF(treap_multiset_impl) x)
|
||||
{ tree_ = ::boost::move(x.tree_); return *this; }
|
||||
|
||||
//! <b>Effects</b>: Detaches all elements from this. The objects in the treap_multiset
|
||||
//! are not deleted (i.e. no destructors are called).
|
||||
//!
|
||||
@@ -2499,6 +2524,8 @@ class treap_multiset
|
||||
Options...
|
||||
#endif
|
||||
>::type Base;
|
||||
//Movable
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(treap_multiset)
|
||||
|
||||
public:
|
||||
typedef typename Base::value_compare value_compare;
|
||||
@@ -2524,6 +2551,13 @@ class treap_multiset
|
||||
: Base(b, e, cmp, pcmp, v_traits)
|
||||
{}
|
||||
|
||||
treap_multiset(BOOST_RV_REF(treap_multiset) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
treap_multiset& operator=(BOOST_RV_REF(treap_multiset) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
|
||||
static treap_multiset &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<treap_multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
|
||||
@@ -16,8 +16,10 @@
|
||||
#include <boost/intrusive/detail/config_begin.hpp>
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/intrusive/hashtable.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
#include <iterator>
|
||||
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
|
||||
@@ -39,7 +41,7 @@ namespace intrusive {
|
||||
//! The container supports the following options:
|
||||
//! \c base_hook<>/member_hook<>/value_traits<>,
|
||||
//! \c constant_time_size<>, \c size_type<>, \c hash<> and \c equal<>
|
||||
//! \c bucket_traits<>, power_2_buckets<> and cache_begin<>.
|
||||
//! \c bucket_traits<>, \c power_2_buckets<> and \c cache_begin<>.
|
||||
//!
|
||||
//! unordered_set only provides forward iterators but it provides 4 iterator types:
|
||||
//! iterator and const_iterator to navigate through the whole container and
|
||||
@@ -68,12 +70,8 @@ class unordered_set_impl
|
||||
typedef hashtable_impl<Config> table_type;
|
||||
|
||||
//! This class is
|
||||
//! non-copyable
|
||||
unordered_set_impl (const unordered_set_impl&);
|
||||
|
||||
//! This class is
|
||||
//! non-assignable
|
||||
unordered_set_impl &operator =(const unordered_set_impl&);
|
||||
//! movable
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(unordered_set_impl)
|
||||
|
||||
typedef table_type implementation_defined;
|
||||
/// @endcond
|
||||
@@ -156,6 +154,17 @@ class unordered_set_impl
|
||||
: table_(b_traits, hash_func, equal_func, v_traits)
|
||||
{ table_.insert_unique(b, e); }
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
unordered_set_impl(BOOST_RV_REF(unordered_set_impl) x)
|
||||
: table_(::boost::move(x.table_))
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
unordered_set_impl& operator=(BOOST_RV_REF(unordered_set_impl) x)
|
||||
{ table_ = ::boost::move(x.table_); return *this; }
|
||||
|
||||
//! <b>Effects</b>: Detaches all elements from this. The objects in the unordered_set
|
||||
//! are not deleted (i.e. no destructors are called).
|
||||
//!
|
||||
@@ -1046,6 +1055,7 @@ class unordered_set
|
||||
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename Base::value_traits::value_type, T>::value));
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(unordered_set)
|
||||
|
||||
public:
|
||||
typedef typename Base::value_traits value_traits;
|
||||
@@ -1073,6 +1083,13 @@ class unordered_set
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(b, e, b_traits, hash_func, equal_func, v_traits)
|
||||
{}
|
||||
|
||||
unordered_set(BOOST_RV_REF(unordered_set) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
unordered_set& operator=(BOOST_RV_REF(unordered_set) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1096,7 +1113,7 @@ class unordered_set
|
||||
//! The container supports the following options:
|
||||
//! \c base_hook<>/member_hook<>/value_traits<>,
|
||||
//! \c constant_time_size<>, \c size_type<>, \c hash<> and \c equal<>
|
||||
//! \c bucket_traits<>, power_2_buckets<> and cache_begin<>.
|
||||
//! \c bucket_traits<>, \c power_2_buckets<> and \c cache_begin<>.
|
||||
//!
|
||||
//! unordered_multiset only provides forward iterators but it provides 4 iterator types:
|
||||
//! iterator and const_iterator to navigate through the whole container and
|
||||
@@ -1125,13 +1142,8 @@ class unordered_multiset_impl
|
||||
typedef hashtable_impl<Config> table_type;
|
||||
/// @endcond
|
||||
|
||||
//! This class is
|
||||
//! non-copyable
|
||||
unordered_multiset_impl (const unordered_multiset_impl&);
|
||||
|
||||
//! This class is
|
||||
//! non-assignable
|
||||
unordered_multiset_impl &operator =(const unordered_multiset_impl&);
|
||||
//Movable
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(unordered_multiset_impl)
|
||||
|
||||
typedef table_type implementation_defined;
|
||||
|
||||
@@ -1213,6 +1225,17 @@ class unordered_multiset_impl
|
||||
: table_(b_traits, hash_func, equal_func, v_traits)
|
||||
{ table_.insert_equal(b, e); }
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
unordered_multiset_impl(BOOST_RV_REF(unordered_multiset_impl) x)
|
||||
: table_(::boost::move(x.table_))
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//!
|
||||
unordered_multiset_impl& operator=(BOOST_RV_REF(unordered_multiset_impl) x)
|
||||
{ table_ = ::boost::move(x.table_); return *this; }
|
||||
|
||||
//! <b>Effects</b>: Detaches all elements from this. The objects in the unordered_multiset
|
||||
//! are not deleted (i.e. no destructors are called).
|
||||
//!
|
||||
@@ -2045,6 +2068,7 @@ class unordered_multiset
|
||||
>::type Base;
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename Base::value_traits::value_type, T>::value));
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(unordered_multiset)
|
||||
|
||||
public:
|
||||
typedef typename Base::value_traits value_traits;
|
||||
@@ -2072,6 +2096,13 @@ class unordered_multiset
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(b, e, b_traits, hash_func, equal_func, v_traits)
|
||||
{}
|
||||
|
||||
unordered_multiset(BOOST_RV_REF(unordered_multiset) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
unordered_multiset& operator=(BOOST_RV_REF(unordered_multiset) x)
|
||||
{ this->Base::operator=(::boost::move(static_cast<Base&>(x))); return *this; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user