Replaced boost/move/move.hpp with a more lightweight boost/move/utility_core.hpp

This commit is contained in:
Ion Gaztañaga
2014-09-25 17:12:55 +02:00
parent c71b6ddb3a
commit 303ac69794
24 changed files with 115 additions and 94 deletions

View File

@ -16,7 +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 <boost/move/utility_core.hpp>
#include <iterator>
namespace boost {

View File

@ -34,7 +34,7 @@
#include <boost/intrusive/detail/utilities.hpp>
#include <boost/intrusive/avltree_algorithms.hpp>
#include <boost/intrusive/link_mode.hpp>
#include <boost/move/move.hpp>
#include <boost/move/utility_core.hpp>
namespace boost {
namespace intrusive {

View File

@ -17,7 +17,7 @@
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/intrusive/bstree.hpp>
#include <iterator>
#include <boost/move/move.hpp>
#include <boost/move/utility_core.hpp>
namespace boost {
namespace intrusive {

View File

@ -34,7 +34,7 @@
#include <boost/intrusive/bstree_algorithms.hpp>
#include <boost/intrusive/link_mode.hpp>
#include <boost/intrusive/parent_from_member.hpp>
#include <boost/move/move.hpp>
#include <boost/move/utility_core.hpp>
namespace boost {
namespace intrusive {
@ -1853,6 +1853,12 @@ class bstree_impl
node_algorithms::init(to_remove);
}
//! <b>Effects</b>: Asserts the integrity of the container with additional checks provided by the user.
//!
//! <b>Complexity</b>: Linear time.
//!
//! <b>Note</b>: The method might not have effect when asserts are turned off (e.g., with NDEBUG).
//! Experimental function, interface might change in future versions.
template <class ExtraChecker>
void check(ExtraChecker extra_checker) const
{
@ -1865,6 +1871,12 @@ class bstree_impl
BOOST_INTRUSIVE_INVARIANT_ASSERT(this->sz_traits().get_size() == checker_return.node_count);
}
//! <b>Effects</b>: Asserts the integrity of the container.
//!
//! <b>Complexity</b>: Linear time.
//!
//! <b>Note</b>: The method has no effect when asserts are turned off (e.g., with NDEBUG).
//! Experimental function, interface might change in future versions.
void check() const
{
check(detail::empty_node_checker<ValueTraits>());

View File

@ -1486,6 +1486,14 @@ class bstree_algorithms
return new_root;
}
//! <b>Effects</b>: Asserts the integrity of the container with additional checks provided by the user.
//!
//! <b>Requires</b>: header must be the header of a tree.
//!
//! <b>Complexity</b>: Linear time.
//!
//! <b>Note</b>: The method might not have effect when asserts are turned off (e.g., with NDEBUG).
//! Experimental function, interface might change in future versions.
template<class Checker>
static void check(const const_node_ptr& header, Checker checker, typename Checker::return_type& checker_return)
{

View File

@ -10,8 +10,7 @@
//
/////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_INTRUSIVE_CONFIG_INCLUDED
#define BOOST_INTRUSIVE_CONFIG_INCLUDED
#ifndef BOOST_CONFIG_HPP
#include <boost/config.hpp>
#endif

View File

@ -19,8 +19,9 @@
#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/detail/preprocessor.hpp>
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/static_assert.hpp>
#include <boost/move/move.hpp>
//Mark that we don't support 0 arg calls due to compiler ICE in GCC 3.4/4.0/4.1 and
//wrong SFINAE for GCC 4.2/4.3

View File

@ -22,7 +22,7 @@
#include <boost/intrusive/detail/assert.hpp>
#include <boost/intrusive/detail/is_stateful_value_traits.hpp>
#include <boost/intrusive/detail/memory_util.hpp>
#include <boost/intrusive/detail/iterator.hpp>
#include <boost/intrusive/detail/reverse_iterator.hpp>
#include <boost/cstdint.hpp>
#include <cstddef>
#include <climits>

View File

@ -34,7 +34,7 @@
#include <boost/intrusive/slist.hpp>
#include <boost/intrusive/pointer_traits.hpp>
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/move/move.hpp>
#include <boost/move/utility_core.hpp>
namespace boost {
namespace intrusive {

View File

@ -30,7 +30,7 @@
#include <algorithm>
#include <functional>
#include <cstddef>
#include <boost/move/move.hpp>
#include <boost/move/utility_core.hpp>
namespace boost {
namespace intrusive {
@ -1267,6 +1267,7 @@ class list_impl
//! <b>Complexity</b>: Linear time.
//!
//! <b>Note</b>: The method has no effect when asserts are turned off (e.g., with NDEBUG).
//! Experimental function, interface might change in future versions.
void check() const
{
const_node_ptr header_ptr = get_root_node();

View File

@ -32,7 +32,7 @@
#include <boost/intrusive/options.hpp>
#include <boost/intrusive/rbtree_algorithms.hpp>
#include <boost/intrusive/link_mode.hpp>
#include <boost/move/move.hpp>
#include <boost/move/utility_core.hpp>
namespace boost {
namespace intrusive {

View File

@ -19,7 +19,7 @@
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/intrusive/rbtree.hpp>
#include <iterator>
#include <boost/move/move.hpp>
#include <boost/move/utility_core.hpp>
namespace boost {
namespace intrusive {

View File

@ -17,7 +17,7 @@
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/intrusive/sgtree.hpp>
#include <iterator>
#include <boost/move/move.hpp>
#include <boost/move/utility_core.hpp>
namespace boost {
namespace intrusive {

View File

@ -39,7 +39,7 @@
#include <boost/intrusive/options.hpp>
#include <boost/intrusive/sgtree_algorithms.hpp>
#include <boost/intrusive/link_mode.hpp>
#include <boost/move/move.hpp>
#include <boost/move/utility_core.hpp>
namespace boost {
namespace intrusive {

View File

@ -31,7 +31,7 @@
#include <algorithm>
#include <cstddef> //std::size_t
#include <utility> //std::pair
#include <boost/move/move.hpp>
#include <boost/move/utility_core.hpp>
namespace boost {
namespace intrusive {
@ -1843,6 +1843,7 @@ class slist_impl
//! <b>Complexity</b>: Linear time.
//!
//! <b>Note</b>: The method has no effect when asserts are turned off (e.g., with NDEBUG).
//! Experimental function, interface might change in future versions.
void check() const
{
const_node_ptr header_ptr = get_root_node();

View File

@ -16,7 +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 <boost/move/utility_core.hpp>
#include <iterator>
namespace boost {

View File

@ -31,7 +31,7 @@
#include <boost/intrusive/options.hpp>
#include <boost/intrusive/splaytree_algorithms.hpp>
#include <boost/intrusive/link_mode.hpp>
#include <boost/move/move.hpp>
#include <boost/move/utility_core.hpp>
namespace boost {
namespace intrusive {

View File

@ -33,7 +33,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/move/utility_core.hpp>
#include <boost/intrusive/priority_compare.hpp>
namespace boost {
@ -904,6 +904,7 @@ class treap_impl
this->tree_type::sz_traits().set_size(0);
}
//! @copydoc ::boost::intrusive::bstree::check(ExtraChecker)const
template <class ExtraChecker>
void check(ExtraChecker extra_checker) const
{
@ -912,10 +913,9 @@ class treap_impl
tree_type::check(detail::treap_node_extra_checker<ValueTraits, nodeptr_prio_comp_t, ExtraChecker>(nodeptr_prio_comp, extra_checker));
}
//! @copydoc ::boost::intrusive::bstree::check()const
void check() const
{
check(detail::empty_node_checker<ValueTraits>());
}
{ check(detail::empty_node_checker<ValueTraits>()); }
#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
//! @copydoc ::boost::intrusive::bstree::count(const_reference)const

View File

@ -16,7 +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 <boost/move/utility_core.hpp>
#include <iterator>
namespace boost {

View File

@ -16,7 +16,7 @@
#include <boost/intrusive/detail/config_begin.hpp>
#include <boost/intrusive/intrusive_fwd.hpp>
#include <boost/intrusive/hashtable.hpp>
#include <boost/move/move.hpp>
#include <boost/move/utility_core.hpp>
#include <iterator>

View File

@ -27,6 +27,9 @@
using namespace boost::intrusive;
BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(reverse_iterator)
BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(const_reverse_iterator)
template<bool Value>
struct boolean
{
@ -51,161 +54,159 @@ void test_sizes(boolean<false>, std::size_t)
{}
template<class C>
void test_iterator_sizes(C &, std::size_t size)
void test_iterator_sizes(std::size_t size)
{
typedef typename C::iterator iterator;
typedef typename C::const_iterator const_iterator;
typedef typename C::iterator iterator;
typedef typename C::const_iterator const_iterator;
typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT
(::, C, reverse_iterator, iterator) reverse_iterator;
typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT
(::, C, const_reverse_iterator, const_iterator) const_reverse_iterator;
BOOST_TEST_EQ(sizeof(iterator), size);
BOOST_TEST_EQ(sizeof(const_iterator), size);
BOOST_TEST_EQ(sizeof(iterator), sizeof(reverse_iterator));
BOOST_TEST_EQ(sizeof(const_iterator), size);
BOOST_TEST_EQ(sizeof(const_iterator), sizeof(const_reverse_iterator));
}
//Test sizes for common 32 and 64 bit architectures
void test_sizes(boolean<true>, std::size_t wordsize)
{
{ //list
list<node< node<list_base_hook<> > > > c;
typedef list<node<list_base_hook<> > > c;
BOOST_TEST_EQ(sizeof(c), wordsize*3);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{
list<node< node<list_base_hook<> > >, constant_time_size<false> > c;
typedef list<node<list_base_hook<> >, constant_time_size<false> > c;
BOOST_TEST_EQ(sizeof(c), wordsize*2);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{
list< node< list_base_hook<> >, header_holder_type< pointer_holder< list_node<void*> > > > c;
typedef list< node< list_base_hook<> >, header_holder_type< pointer_holder< list_node<void*> > > > c;
BOOST_TEST_EQ(sizeof(c), wordsize*2);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{
list< node< list_base_hook<> >, constant_time_size<false>, header_holder_type< pointer_holder< list_node<void*> > > > c;
typedef list< node< list_base_hook<> >, constant_time_size<false>, header_holder_type< pointer_holder< list_node<void*> > > > c;
BOOST_TEST_EQ(sizeof(c), wordsize*1);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{ //slist
slist<node< node< slist_base_hook<> > > > c;
typedef slist<node< slist_base_hook<> > > c;
BOOST_TEST_EQ(sizeof(c), wordsize*2);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{
slist<node< node< slist_base_hook<> > > , constant_time_size<false> > c;
typedef slist<node< slist_base_hook<> >, constant_time_size<false> > c;
BOOST_TEST_EQ(sizeof(c), wordsize*1);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{
slist<node< node< slist_base_hook<> > > , cache_last<true> > c;
typedef slist<node< slist_base_hook<> >, cache_last<true> > c;
BOOST_TEST_EQ(sizeof(c), wordsize*3);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{ //set
set<node< node< set_base_hook<> > > > c;
typedef set<node< set_base_hook<> > > c;
BOOST_TEST_EQ(sizeof(c), wordsize*5);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{
set<node< node< set_base_hook<> > > , constant_time_size<false> > c;
typedef set<node< set_base_hook<> > , constant_time_size<false> > c;
BOOST_TEST_EQ(sizeof(c), wordsize*4);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{
set<node< node< set_base_hook<optimize_size<true> > > > , constant_time_size<false> > c;
typedef set<node< set_base_hook<optimize_size<true> > > , constant_time_size<false> > c;
BOOST_TEST_EQ(sizeof(c), wordsize*3);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{
set< node< set_base_hook<> >, header_holder_type< pointer_holder< rbtree_node<void*> > > > c;
typedef set< node< set_base_hook<> >, header_holder_type< pointer_holder< rbtree_node<void*> > > > c;
BOOST_TEST_EQ(sizeof(c), wordsize*2);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{
set< node< set_base_hook<> >, constant_time_size<false>, header_holder_type< pointer_holder< rbtree_node<void*> > > > c;
typedef set< node< set_base_hook<> >, constant_time_size<false>, header_holder_type< pointer_holder< rbtree_node<void*> > > > c;
BOOST_TEST_EQ(sizeof(c), wordsize*1);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{ //avl
avl_set<node< node< avl_set_base_hook<> > > > c;
typedef avl_set<node< avl_set_base_hook<> > > c;
BOOST_TEST_EQ(sizeof(c), wordsize*5);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{
avl_set<node< node< avl_set_base_hook<> > > , constant_time_size<false> > c;
typedef avl_set<node< avl_set_base_hook<> > , constant_time_size<false> > c;
BOOST_TEST_EQ(sizeof(c), wordsize*4);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{
avl_set<node< node< avl_set_base_hook<optimize_size<true> > > > , constant_time_size<false> > c;
typedef avl_set<node< avl_set_base_hook<optimize_size<true> > > , constant_time_size<false> > c;
BOOST_TEST_EQ(sizeof(c), wordsize*3);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{
avl_set< node< avl_set_base_hook<> >, header_holder_type< pointer_holder< avltree_node<void*> > > > c;
typedef avl_set< node< avl_set_base_hook<> >, header_holder_type< pointer_holder< avltree_node<void*> > > > c;
BOOST_TEST_EQ(sizeof(c), wordsize*2);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{
avl_set< node< avl_set_base_hook<> >, constant_time_size<false>, header_holder_type< pointer_holder< avltree_node<void*> > > > c;
typedef avl_set< node< avl_set_base_hook<> >, constant_time_size<false>, header_holder_type< pointer_holder< avltree_node<void*> > > > c;
BOOST_TEST_EQ(sizeof(c), wordsize*1);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{ //splay
splay_set<node< node< bs_set_base_hook<> > > > c;
typedef splay_set<node< bs_set_base_hook<> > > c;
BOOST_TEST_EQ(sizeof(c), wordsize*4);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{
splay_set<node< node< bs_set_base_hook<> > > , constant_time_size<false> > c;
typedef splay_set<node< bs_set_base_hook<> > , constant_time_size<false> > c;
BOOST_TEST_EQ(sizeof(c), wordsize*3);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{ //scapegoat
sg_set<node< bs_set_base_hook<> > > c;
typedef sg_set<node< bs_set_base_hook<> > > c;
BOOST_TEST_EQ(sizeof(c), (wordsize*5+sizeof(float)*2));
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{ //treap
treap_set<node< bs_set_base_hook<> > > c;
typedef treap_set<node< bs_set_base_hook<> > > c;
BOOST_TEST_EQ(sizeof(c), wordsize*4);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{
treap_set<node< bs_set_base_hook<> > , constant_time_size<false> > c;
typedef treap_set<node< bs_set_base_hook<> > , constant_time_size<false> > c;
BOOST_TEST_EQ(sizeof(c), wordsize*3);
test_iterator_sizes(c, wordsize);
test_iterator_sizes<c>(wordsize);
}
{ //unordered
typedef unordered_set<node< unordered_set_base_hook<> > > cont_type;
cont_type::bucket_type buckets[1];
cont_type c(cont_type::bucket_traits(buckets, 1));
typedef unordered_set<node< unordered_set_base_hook<> > > c;
BOOST_TEST_EQ(sizeof(c), wordsize*3);
test_iterator_sizes(c, wordsize*2);
test_iterator_sizes<c>(wordsize*2);
}
{
typedef unordered_set<node< unordered_set_base_hook<> > , power_2_buckets<true> > cont_type;
cont_type::bucket_type buckets[1];
cont_type c(cont_type::bucket_traits(buckets, 1));
typedef unordered_set<node< unordered_set_base_hook<> > , power_2_buckets<true> > c;
BOOST_TEST_EQ(sizeof(c), wordsize*3);
test_iterator_sizes(c, wordsize*2);
test_iterator_sizes<c>(wordsize*2);
}
{
typedef unordered_set<node< unordered_set_base_hook<> >, constant_time_size<false> > cont_type;
cont_type::bucket_type buckets[1];
cont_type c(cont_type::bucket_traits(buckets, 1));
typedef unordered_set<node< unordered_set_base_hook<> >, constant_time_size<false> > c;
BOOST_TEST_EQ(sizeof(c), wordsize*2);
test_iterator_sizes(c, wordsize*2);
test_iterator_sizes<c>(wordsize*2);
}
{
typedef unordered_set<node< unordered_set_base_hook< optimize_multikey<true> > >, constant_time_size<false> > cont_type;
cont_type::bucket_type buckets[1];
cont_type c(cont_type::bucket_traits(buckets, 1));
typedef unordered_set<node< unordered_set_base_hook< optimize_multikey<true> > >, constant_time_size<false> > c;
BOOST_TEST_EQ(sizeof(c), wordsize*2);
test_iterator_sizes(c, wordsize*2);
test_iterator_sizes<c>(wordsize*2);
}
{
typedef unordered_set<node< unordered_set_base_hook< optimize_multikey<true> > >, incremental<true> > cont_type;
cont_type::bucket_type buckets[1];
cont_type c(cont_type::bucket_traits(buckets, 1));
typedef unordered_set<node< unordered_set_base_hook< optimize_multikey<true> > >, incremental<true> > c;
BOOST_TEST_EQ(sizeof(c), wordsize*4);
test_iterator_sizes(c, wordsize*2);
test_iterator_sizes<c>(wordsize*2);
}
}

View File

@ -13,7 +13,7 @@
//Just for BOOST_INTRUSIVE_DETAIL_HAS_MEMBER_FUNCTION_CALLABLE_WITH_0_ARGS_UNSUPPORTED
#include <boost/intrusive/detail/has_member_function_callable_with.hpp>
#include <cstddef>
#include <boost/move/move.hpp>
#include <boost/move/utility_core.hpp>
namespace boost{
namespace intrusive{

View File

@ -26,8 +26,6 @@
using namespace boost::intrusive;
#include <boost/intrusive/detail/memory_util.hpp>
struct Type
: list_base_hook<>
, slist_base_hook<>

View File

@ -15,7 +15,7 @@
#include <boost/detail/lightweight_test.hpp>
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/move/move.hpp>
#include <boost/move/utility_core.hpp>
namespace boost {
namespace intrusive {