forked from boostorg/intrusive
Changes to correct regression tests for intel-win-9.1 & cw-9.4
[SVN r37676]
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -18,9 +18,7 @@
|
||||
#include <iterator>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/intrusive/detail/pointer_type.hpp>
|
||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||
#include <boost/get_pointer.hpp>
|
||||
#include <cstddef>
|
||||
|
||||
namespace boost {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -18,9 +18,7 @@
|
||||
#include <iterator>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/intrusive/detail/pointer_type.hpp>
|
||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||
#include <boost/get_pointer.hpp>
|
||||
#include <cstddef>
|
||||
|
||||
namespace boost {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -39,10 +39,5 @@
|
||||
#pragma warning (disable : 4267) //conversion from 'X' to 'Y', possible loss of data
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
# pragma warn -8026 // shut up warning "cannot inline function because ..."
|
||||
# pragma warn -8027 // shut up warning "cannot inline function because ..."
|
||||
#endif
|
||||
//#define BOOST_INTRUSIVE_USE_ITERATOR_FACADE
|
||||
//#define BOOST_INTRUSIVE_USE_ITERATOR_ENABLE_IF_CONVERTIBLE
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -9,14 +9,7 @@
|
||||
// See http://www.boost.org/libs/intrusive for documentation.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if defined _MSC_VER
|
||||
#if defined BOOST_MSVC
|
||||
#pragma warning (pop)
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
# pragma warn .8026
|
||||
# pragma warn .8027
|
||||
#endif
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gazta<EFBFBD>ga 2007
|
||||
// (C) Copyright Ion Gaztanaga 2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -16,10 +16,8 @@
|
||||
#include <boost/intrusive/detail/config_begin.hpp>
|
||||
#include <iterator>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/intrusive/detail/pointer_type.hpp>
|
||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||
#include <boost/intrusive/circular_list_algorithms.hpp>
|
||||
#include <boost/get_pointer.hpp>
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
@@ -169,7 +167,6 @@ class hashtable_iterator
|
||||
|
||||
void increment()
|
||||
{
|
||||
using boost::get_pointer;
|
||||
size_type buckets_len = bucket_info_->buckets_len_;
|
||||
const_bucket_ptr buckets = bucket_info_->buckets_;
|
||||
const_local_iterator first = bucket_type::bucket_to_slist(buckets[0]).cend();
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -17,13 +17,15 @@
|
||||
#include <boost/intrusive/detail/config_begin.hpp>
|
||||
#include <iterator>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/intrusive/detail/pointer_type.hpp>
|
||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||
#include <boost/intrusive/circular_list_algorithms.hpp>
|
||||
#include <boost/get_pointer.hpp>
|
||||
#ifdef BOOST_INTRUSIVE_USE_ITERATOR_FACADE
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#endif
|
||||
#ifdef BOOST_INTRUSIVE_USE_ITERATOR_ENABLE_IF_CONVERTIBLE
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#endif
|
||||
#include <cstddef>
|
||||
|
||||
namespace boost {
|
||||
@@ -60,6 +62,8 @@ struct list_node_traits
|
||||
{ n->next_ = next; }
|
||||
};
|
||||
|
||||
#ifdef BOOST_INTRUSIVE_USE_ITERATOR_FACADE
|
||||
|
||||
// list_iterator provides some basic functions for a
|
||||
// node oriented forward iterator:
|
||||
template<class T, class ValueTraits>
|
||||
@@ -123,6 +127,102 @@ class list_iterator
|
||||
node_ptr node_;
|
||||
};
|
||||
|
||||
#else //BOOST_INTRUSIVE_USE_ITERATOR_FACADE
|
||||
|
||||
// list_iterator provides some basic functions for a
|
||||
// node oriented bidirectional iterator:
|
||||
template<class T, class ValueTraits>
|
||||
class list_iterator
|
||||
: public std::iterator<std::bidirectional_iterator_tag, T>
|
||||
{
|
||||
struct enabler{};
|
||||
protected:
|
||||
typedef typename ValueTraits::node_traits node_traits;
|
||||
typedef typename node_traits::node node;
|
||||
typedef typename node_traits::node_ptr node_ptr;
|
||||
|
||||
public:
|
||||
typedef T & reference;
|
||||
typedef T * pointer;
|
||||
|
||||
list_iterator()
|
||||
: node_ (0)
|
||||
{}
|
||||
|
||||
explicit list_iterator(node_ptr node)
|
||||
: node_ (node)
|
||||
{}
|
||||
#ifdef BOOST_INTRUSIVE_USE_ITERATOR_ENABLE_IF_CONVERTIBLE
|
||||
template <class OtherValue>
|
||||
list_iterator(list_iterator<OtherValue, ValueTraits> const& other
|
||||
,typename boost::enable_if<
|
||||
boost::is_convertible<OtherValue*,T*>
|
||||
, enabler
|
||||
>::type = enabler()
|
||||
)
|
||||
: node_(other.pointed_node())
|
||||
{}
|
||||
#else
|
||||
template <class OtherValue>
|
||||
list_iterator(list_iterator<OtherValue, ValueTraits> const& other,
|
||||
typename enable_if<
|
||||
is_convertible<OtherValue*,T*>
|
||||
>::type* = 0)
|
||||
: node_(other.pointed_node())
|
||||
{}
|
||||
#endif
|
||||
|
||||
const node_ptr &pointed_node() const
|
||||
{ return node_; }
|
||||
|
||||
list_iterator &operator=(const node_ptr &node)
|
||||
{ node_ = node; return static_cast<list_iterator&>(*this); }
|
||||
|
||||
public:
|
||||
list_iterator& operator++()
|
||||
{
|
||||
node_ = node_traits::get_next(node_);
|
||||
return static_cast<list_iterator&> (*this);
|
||||
}
|
||||
|
||||
list_iterator operator++(int)
|
||||
{
|
||||
list_iterator result (node_);
|
||||
node_ = node_traits::get_next(node_);
|
||||
return result;
|
||||
}
|
||||
|
||||
list_iterator& operator--()
|
||||
{
|
||||
node_ = node_traits::get_previous(node_);
|
||||
return static_cast<list_iterator&> (*this);
|
||||
}
|
||||
|
||||
list_iterator operator--(int)
|
||||
{
|
||||
list_iterator result (node_);
|
||||
node_ = node_traits::get_previous(node_);
|
||||
return result;
|
||||
}
|
||||
|
||||
bool operator== (const list_iterator& i) const
|
||||
{ return node_ == i.pointed_node(); }
|
||||
|
||||
bool operator!= (const list_iterator& i) const
|
||||
{ return !operator== (i); }
|
||||
|
||||
T& operator*() const
|
||||
{ return *ValueTraits::to_value_ptr(node_); }
|
||||
|
||||
pointer operator->() const
|
||||
{ return detail::get_pointer(ValueTraits::to_value_ptr(node_)); }
|
||||
|
||||
private:
|
||||
node_ptr node_;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
} //namespace detail
|
||||
} //namespace intrusive
|
||||
} //namespace boost
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2007
|
||||
// (C) Copyright Ion Gaztanaga 2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -12,6 +12,8 @@
|
||||
#ifndef BOOST_INTRUSIVE_PARENT_FROM_MEMBER_HPP
|
||||
#define BOOST_INTRUSIVE_PARENT_FROM_MEMBER_HPP
|
||||
|
||||
#include <boost/intrusive/detail/config_begin.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
namespace detail {
|
||||
@@ -20,9 +22,12 @@ template<class Parent, class Member>
|
||||
std::size_t offset_from_pointer_to_member(const Member Parent::* ptr_to_member)
|
||||
{
|
||||
//This works with gcc and msvc
|
||||
//The implementation of a pointer to member is compiler dependent.
|
||||
#if defined(BOOST_MSVC) || defined(__GNUC__) || defined(BOOST_INTEL)
|
||||
return *(const std::size_t*)(const void*)&ptr_to_member;
|
||||
//Other compilers might need other transformation, depending how a
|
||||
//pointer to data member is implemented.
|
||||
#else //CW 9.4
|
||||
return *(const std::size_t*)(const void*)&ptr_to_member - 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
template<class Parent, class Member>
|
||||
@@ -43,4 +48,6 @@ const Parent *parent_from_member(const Member *member, const Member Parent::* pt
|
||||
} //namespace intrusive {
|
||||
} //namespace boost {
|
||||
|
||||
#include <boost/intrusive/detail/config_end.hpp>
|
||||
|
||||
#endif //#ifndef BOOST_INTRUSIVE_PARENT_FROM_MEMBER_HPP
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2006. 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)
|
||||
//
|
||||
|
@@ -1,54 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gazta<74>aga 2006. 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/intrusive for documentation.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef BOOST_INTRUSIVE_POINTER_TYPE_HPP
|
||||
#define BOOST_INTRUSIVE_POINTER_TYPE_HPP
|
||||
|
||||
#include <boost/intrusive/detail/config_begin.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
namespace detail {
|
||||
|
||||
struct two {char _[2];};
|
||||
|
||||
namespace pointer_type_imp
|
||||
{
|
||||
|
||||
template <class U> static two test(...);
|
||||
template <class U> static char test(typename U::pointer* = 0);
|
||||
|
||||
} //namespace pointer_type_imp
|
||||
|
||||
template <class T>
|
||||
struct has_pointer_type
|
||||
{
|
||||
static const bool value = sizeof(pointer_type_imp::test<T>(0)) == 1;
|
||||
};
|
||||
|
||||
template <class T, class A, bool = has_pointer_type<A>::value>
|
||||
struct pointer_type
|
||||
{
|
||||
typedef typename A::pointer type;
|
||||
};
|
||||
|
||||
template <class T, class A>
|
||||
struct pointer_type<T, A, false>
|
||||
{
|
||||
typedef T* type;
|
||||
};
|
||||
|
||||
} //namespace detail
|
||||
} //namespace intrusive
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/intrusive/detail/config_end.hpp>
|
||||
|
||||
#endif //#ifndef BOOST_INTRUSIVE_POINTER_TYPE_HPP
|
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -17,16 +17,18 @@
|
||||
#include <boost/intrusive/detail/config_begin.hpp>
|
||||
#include <iterator>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/intrusive/detail/pointer_type.hpp>
|
||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||
#include <boost/intrusive/rbtree_algorithms.hpp>
|
||||
#include <boost/get_pointer.hpp>
|
||||
#include <boost/type_traits/alignment_of.hpp>
|
||||
#include <cstddef>
|
||||
#include <boost/detail/no_exceptions_support.hpp>
|
||||
#ifdef BOOST_INTRUSIVE_USE_ITERATOR_FACADE
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#endif
|
||||
#ifdef BOOST_INTRUSIVE_USE_ITERATOR_ENABLE_IF_CONVERTIBLE
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#endif
|
||||
#include <boost/intrusive/pointer_plus_bit.hpp>
|
||||
|
||||
namespace boost {
|
||||
@@ -186,6 +188,8 @@ struct rbtree_node_traits
|
||||
// //
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef BOOST_INTRUSIVE_USE_ITERATOR_FACADE
|
||||
|
||||
template<class T, class ValueTraits>
|
||||
class rbtree_iterator
|
||||
: public boost::iterator_facade
|
||||
@@ -248,6 +252,104 @@ class rbtree_iterator
|
||||
node_ptr node_;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
// rbtree_iterator provides some basic functions for a
|
||||
// node oriented bidirectional iterator:
|
||||
template<class T, class ValueTraits>
|
||||
class rbtree_iterator
|
||||
: public std::iterator<std::bidirectional_iterator_tag, T>
|
||||
{
|
||||
struct enabler{};
|
||||
protected:
|
||||
typedef typename ValueTraits::node_traits node_traits;
|
||||
typedef typename node_traits::node node;
|
||||
typedef typename node_traits::node_ptr node_ptr;
|
||||
typedef rbtree_algorithms<node_traits> node_algorithms;
|
||||
|
||||
public:
|
||||
typedef T & reference;
|
||||
typedef T * pointer;
|
||||
|
||||
rbtree_iterator()
|
||||
: node_ (0)
|
||||
{}
|
||||
|
||||
explicit rbtree_iterator(node_ptr node)
|
||||
: node_ (node)
|
||||
{}
|
||||
|
||||
#ifdef BOOST_INTRUSIVE_USE_ITERATOR_ENABLE_IF_CONVERTIBLE
|
||||
template <class OtherValue>
|
||||
rbtree_iterator(rbtree_iterator<OtherValue, ValueTraits> const& other
|
||||
,typename boost::enable_if<
|
||||
boost::is_convertible<OtherValue*,T*>
|
||||
, enabler
|
||||
>::type = enabler()
|
||||
)
|
||||
: node_(other.pointed_node())
|
||||
{}
|
||||
#else
|
||||
template <class OtherValue>
|
||||
rbtree_iterator(rbtree_iterator<OtherValue, ValueTraits> const& other,
|
||||
typename enable_if<
|
||||
is_convertible<OtherValue*,T*>
|
||||
>::type* = 0)
|
||||
: node_(other.pointed_node())
|
||||
{}
|
||||
#endif
|
||||
|
||||
const node_ptr &pointed_node() const
|
||||
{ return node_; }
|
||||
|
||||
rbtree_iterator &operator=(const node_ptr &node)
|
||||
{ node_ = node; return static_cast<rbtree_iterator&>(*this); }
|
||||
|
||||
public:
|
||||
rbtree_iterator& operator++()
|
||||
{
|
||||
node_ = node_algorithms::next_node(node_);
|
||||
return static_cast<rbtree_iterator&> (*this);
|
||||
}
|
||||
|
||||
rbtree_iterator operator++(int)
|
||||
{
|
||||
rbtree_iterator result (node_);
|
||||
node_ = node_algorithms::next_node(node_);
|
||||
return result;
|
||||
}
|
||||
|
||||
rbtree_iterator& operator--()
|
||||
{
|
||||
node_ = node_algorithms::prev_node(node_);
|
||||
return static_cast<rbtree_iterator&> (*this);
|
||||
}
|
||||
|
||||
rbtree_iterator operator--(int)
|
||||
{
|
||||
rbtree_iterator result (node_);
|
||||
node_ = node_algorithms::prev_node(node_);
|
||||
return result;
|
||||
}
|
||||
|
||||
bool operator== (const rbtree_iterator& i) const
|
||||
{ return node_ == i.pointed_node(); }
|
||||
|
||||
bool operator!= (const rbtree_iterator& i) const
|
||||
{ return !operator== (i); }
|
||||
|
||||
T& operator*() const
|
||||
{ return *ValueTraits::to_value_ptr(node_); }
|
||||
|
||||
pointer operator->() const
|
||||
{ return detail::get_pointer(ValueTraits::to_value_ptr(node_)); }
|
||||
|
||||
private:
|
||||
node_ptr node_;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
} //namespace detail
|
||||
} //namespace intrusive
|
||||
} //namespace boost
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -17,13 +17,15 @@
|
||||
#include <boost/intrusive/detail/config_begin.hpp>
|
||||
#include <iterator>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/intrusive/detail/pointer_type.hpp>
|
||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||
#include <boost/intrusive/circular_slist_algorithms.hpp>
|
||||
#include <boost/get_pointer.hpp>
|
||||
#ifdef BOOST_INTRUSIVE_USE_ITERATOR_FACADE
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#endif
|
||||
#ifdef BOOST_INTRUSIVE_USE_ITERATOR_ENABLE_IF_CONVERTIBLE
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#endif
|
||||
#include <cstddef>
|
||||
|
||||
namespace boost {
|
||||
@@ -55,6 +57,7 @@ struct slist_node_traits
|
||||
{ n->next_ = next; }
|
||||
};
|
||||
|
||||
#ifdef BOOST_INTRUSIVE_USE_ITERATOR_FACADE
|
||||
|
||||
// slist_iterator provides some basic functions for a
|
||||
// node oriented forward iterator:
|
||||
@@ -86,6 +89,7 @@ class slist_iterator
|
||||
: node_ (node)
|
||||
{}
|
||||
|
||||
#ifdef BOOST_INTRUSIVE_USE_ITERATOR_ENABLE_IF_CONVERTIBLE
|
||||
template <class OtherValue>
|
||||
slist_iterator(slist_iterator<OtherValue, ValueTraits> const& other
|
||||
,typename boost::enable_if<
|
||||
@@ -95,6 +99,15 @@ class slist_iterator
|
||||
)
|
||||
: node_(other.pointed_node())
|
||||
{}
|
||||
#else
|
||||
template <class OtherValue>
|
||||
slist_iterator(slist_iterator<OtherValue, ValueTraits> const& other,
|
||||
typename enable_if<
|
||||
is_convertible<OtherValue*,T*>
|
||||
>::type* = 0)
|
||||
: node_(other.pointed_node())
|
||||
{}
|
||||
#endif
|
||||
|
||||
const node_ptr &pointed_node() const
|
||||
{ return node_; }
|
||||
@@ -116,6 +129,85 @@ class slist_iterator
|
||||
node_ptr node_;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
// slist_iterator provides some basic functions for a
|
||||
// node oriented bidirectional iterator:
|
||||
template<class T, class ValueTraits>
|
||||
class slist_iterator
|
||||
: public std::iterator<std::forward_iterator_tag, T>
|
||||
{
|
||||
struct enabler{};
|
||||
protected:
|
||||
typedef typename ValueTraits::node_traits node_traits;
|
||||
typedef typename node_traits::node node;
|
||||
typedef typename node_traits::node_ptr node_ptr;
|
||||
|
||||
public:
|
||||
typedef T & reference;
|
||||
typedef T * pointer;
|
||||
|
||||
slist_iterator()
|
||||
: node_ (0)
|
||||
{}
|
||||
|
||||
explicit slist_iterator(node_ptr node)
|
||||
: node_ (node)
|
||||
{}
|
||||
/*
|
||||
template <class OtherValue>
|
||||
slist_iterator(slist_iterator<OtherValue, ValueTraits> const& other
|
||||
,typename boost::enable_if<
|
||||
boost::is_convertible<OtherValue*,T*>
|
||||
, enabler
|
||||
>::type = enabler()
|
||||
)
|
||||
: node_(other.pointed_node())
|
||||
{}
|
||||
*/
|
||||
template <class OtherValue>
|
||||
slist_iterator(slist_iterator<OtherValue, ValueTraits> const& other)
|
||||
: node_(other.pointed_node())
|
||||
{}
|
||||
|
||||
const node_ptr &pointed_node() const
|
||||
{ return node_; }
|
||||
|
||||
slist_iterator &operator=(const node_ptr &node)
|
||||
{ node_ = node; return static_cast<slist_iterator&>(*this); }
|
||||
|
||||
public:
|
||||
slist_iterator& operator++()
|
||||
{
|
||||
node_ = node_traits::get_next(node_);
|
||||
return static_cast<slist_iterator&> (*this);
|
||||
}
|
||||
|
||||
slist_iterator operator++(int)
|
||||
{
|
||||
slist_iterator result (node_);
|
||||
node_ = node_traits::get_next(node_);
|
||||
return result;
|
||||
}
|
||||
|
||||
bool operator== (const slist_iterator& i) const
|
||||
{ return node_ == i.pointed_node(); }
|
||||
|
||||
bool operator!= (const slist_iterator& i) const
|
||||
{ return !operator== (i); }
|
||||
|
||||
T& operator*() const
|
||||
{ return *ValueTraits::to_value_ptr(node_); }
|
||||
|
||||
pointer operator->() const
|
||||
{ return detail::get_pointer(ValueTraits::to_value_ptr(node_)); }
|
||||
|
||||
private:
|
||||
node_ptr node_;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
} //namespace detail
|
||||
} //namespace intrusive
|
||||
} //namespace boost
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -14,18 +14,41 @@
|
||||
#define BOOST_INTRUSIVE_DETAIL_UTILITIES_HPP
|
||||
|
||||
#include <boost/intrusive/detail/config_begin.hpp>
|
||||
#include <boost/intrusive/detail/pointer_type.hpp>
|
||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||
#include <boost/intrusive/detail/parent_from_member.hpp>
|
||||
#include <boost/intrusive/detail/ebo_holder.hpp>
|
||||
#include <boost/intrusive/linking_policy.hpp>
|
||||
#include <boost/get_pointer.hpp>
|
||||
#include <cstddef>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
namespace detail {
|
||||
|
||||
template<class SmartPtr>
|
||||
struct smart_ptr_type
|
||||
{
|
||||
typedef typename SmartPtr::value_type value_type;
|
||||
typedef value_type *pointer;
|
||||
static pointer get (const SmartPtr &smartptr)
|
||||
{ return smartptr.get();}
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct smart_ptr_type<T*>
|
||||
{
|
||||
typedef T value_type;
|
||||
typedef value_type *pointer;
|
||||
static pointer get (pointer ptr)
|
||||
{ return ptr;}
|
||||
};
|
||||
|
||||
//!Overload for smart pointers to avoid ADL problems with get_pointer
|
||||
template<class Ptr>
|
||||
inline typename smart_ptr_type<Ptr>::pointer
|
||||
get_pointer(const Ptr &ptr)
|
||||
{ return smart_ptr_type<Ptr>::get(ptr); }
|
||||
//{ using boost::get_pointer; return get_pointer(ptr); }
|
||||
|
||||
//This functor compares a stored value
|
||||
//and the one passed as an argument
|
||||
template<class ConstReference>
|
||||
@@ -112,14 +135,12 @@ struct derivation_value_traits
|
||||
|
||||
static pointer to_value_ptr(node_ptr n)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return static_cast<T*>(get_pointer(DerivationHookType::to_hook_ptr(n)));
|
||||
return static_cast<T*>(detail::get_pointer(DerivationHookType::to_hook_ptr(n)));
|
||||
}
|
||||
|
||||
static const_pointer to_value_ptr(const_node_ptr n)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return static_cast<const T*>(get_pointer(DerivationHookType::to_hook_ptr(n)));
|
||||
return static_cast<const T*>(detail::get_pointer(DerivationHookType::to_hook_ptr(n)));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -158,27 +179,14 @@ struct member_value_traits
|
||||
//the needed bytes.
|
||||
static pointer to_value_ptr(node_ptr n)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return pointer(parent_from_member((MemberHookType*)get_pointer(n), P));
|
||||
return pointer(parent_from_member<value_type, MemberHookType>
|
||||
((MemberHookType*)detail::get_pointer(n), P));
|
||||
}
|
||||
|
||||
static const_pointer to_value_ptr(const_node_ptr n)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
const_pointer(parent_from_member<value_type>((const MemberHookType*)get_pointer(n), P));
|
||||
}
|
||||
|
||||
private:
|
||||
//This function converts a pointer to data member into an offset.
|
||||
//This function is not standard and it's compiler-dependent.
|
||||
static std::size_t value_to_node_offset()
|
||||
{
|
||||
const MemberHookType T::* const p = P;
|
||||
return *(const std::size_t*)(const void *)(&p);
|
||||
// using boost::get_pointer;
|
||||
// const typename node_traits::node *np =
|
||||
// get_pointer((((const value_type *)get_pointer(n))->*P).to_node_ptr());
|
||||
// return ((const char*)np - (const char*)(const value_type *)get_pointer(n));
|
||||
const_pointer(parent_from_member<value_type, MemberHookType>
|
||||
((const MemberHookType*)detail::get_pointer(n), P));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -207,7 +215,6 @@ struct key_node_ptr_compare
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template<class F, class ValueTraits>
|
||||
struct value_to_node_cloner
|
||||
: private detail::ebo_holder<F>
|
||||
@@ -243,14 +250,14 @@ struct dispatcher
|
||||
|
||||
template<class Container>
|
||||
void destructor_impl(Container &cont, dispatcher<safe_link>)
|
||||
{ BOOST_ASSERT(!cont.is_linked()); }
|
||||
{ (void)cont; BOOST_ASSERT(!cont.is_linked()); }
|
||||
|
||||
template<class Container>
|
||||
void destructor_impl(Container &cont, dispatcher<auto_unlink>)
|
||||
{ cont.unlink(); }
|
||||
|
||||
template<class Container>
|
||||
void destructor_impl(Container &cont, dispatcher<normal_link>)
|
||||
void destructor_impl(Container &, dispatcher<normal_link>)
|
||||
{}
|
||||
|
||||
template<class Node, class MaybeClass>
|
||||
@@ -283,6 +290,32 @@ struct node_plus_pred
|
||||
{ return static_cast<const node_plus_pred*>(n); }
|
||||
};
|
||||
|
||||
#ifndef BOOST_INTRUSIVE_USE_ITERATOR_ENABLE_IF_CONVERTIBLE
|
||||
|
||||
template <bool B, class T = void>
|
||||
struct enable_if_c {
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct enable_if_c<false, T> {};
|
||||
|
||||
template <class Cond, class T = void>
|
||||
struct enable_if : public enable_if_c<Cond::value, T> {};
|
||||
|
||||
template <class T, class U>
|
||||
class is_convertible
|
||||
{
|
||||
typedef char true_t;
|
||||
class false_t { char dummy[2]; };
|
||||
static true_t dispatch(U);
|
||||
static false_t dispatch(...);
|
||||
static T trigger();
|
||||
public:
|
||||
enum { value = sizeof(dispatch(trigger())) == sizeof(true_t) };
|
||||
};
|
||||
|
||||
#endif //#ifndef BOOST_INTRUSIVE_USE_ITERATOR_ENABLE_IF_CONVERTIBLE
|
||||
|
||||
} //namespace detail
|
||||
} //namespace intrusive
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <boost/functional/hash.hpp>
|
||||
//General intrusive utilities
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/intrusive/detail/pointer_type.hpp>
|
||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||
#include <boost/intrusive/detail/hashtable_node.hpp>
|
||||
#include <boost/intrusive/linking_policy.hpp>
|
||||
@@ -143,14 +142,12 @@ class hashtable
|
||||
|
||||
static node_ptr uncast(const_node_ptr ptr)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return node_ptr(const_cast<node*>(get_pointer(ptr)));
|
||||
return node_ptr(const_cast<node*>(detail::get_pointer(ptr)));
|
||||
}
|
||||
|
||||
static bucket_info_ptr uncast(const_bucket_info_ptr ptr)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return bucket_info_ptr(const_cast<bucket_info_t*>(get_pointer(ptr)));
|
||||
return bucket_info_ptr(const_cast<bucket_info_t*>(detail::get_pointer(ptr)));
|
||||
}
|
||||
|
||||
static slist_impl &bucket_to_slist(bucket_type &b)
|
||||
@@ -204,8 +201,7 @@ class hashtable
|
||||
|
||||
iterator end()
|
||||
{
|
||||
using boost::get_pointer;
|
||||
bucket_info_t *info = get_pointer(this->priv_bucket_info());
|
||||
bucket_info_t *info = detail::get_pointer(this->priv_bucket_info());
|
||||
return iterator(invalid_local_it(*info), 0);
|
||||
}
|
||||
|
||||
@@ -214,8 +210,7 @@ class hashtable
|
||||
|
||||
const_iterator cend() const
|
||||
{
|
||||
using boost::get_pointer;
|
||||
const bucket_info_t *info = get_pointer(this->priv_bucket_info());
|
||||
const bucket_info_t *info = detail::get_pointer(this->priv_bucket_info());
|
||||
return const_iterator(invalid_local_it(*info), 0);
|
||||
}
|
||||
|
||||
@@ -231,9 +226,8 @@ class hashtable
|
||||
return !size();
|
||||
}
|
||||
else{
|
||||
using boost::get_pointer;
|
||||
size_type buckets_len = this->priv_buckets_len();
|
||||
const bucket_type *b = get_pointer(this->priv_buckets());
|
||||
const bucket_type *b = detail::get_pointer(this->priv_buckets());
|
||||
for (size_type n = 0; n < buckets_len; ++n, ++b){
|
||||
if(!b->empty()){
|
||||
return false;
|
||||
@@ -249,9 +243,8 @@ class hashtable
|
||||
return size_traits::get_size();
|
||||
else{
|
||||
size_type len = 0;
|
||||
using boost::get_pointer;
|
||||
size_type buckets_len = this->priv_buckets_len();
|
||||
const bucket_type *b = get_pointer(this->priv_buckets());
|
||||
const bucket_type *b = detail::get_pointer(this->priv_buckets());
|
||||
for (size_type n = 0; n < buckets_len; ++n, ++b){
|
||||
len += b->size();
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2007
|
||||
// (C) Copyright Ion Gaztanaga 2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -20,10 +20,8 @@
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/intrusive/list_hook.hpp>
|
||||
#include <boost/intrusive/circular_list_algorithms.hpp>
|
||||
#include <boost/intrusive/detail/pointer_type.hpp>
|
||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||
#include <boost/intrusive/linking_policy.hpp>
|
||||
#include <boost/get_pointer.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
@@ -97,8 +95,8 @@ class list
|
||||
//Const cast emulation for smart pointers
|
||||
static node_ptr uncast(const_node_ptr ptr)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return node_ptr(const_cast<node*>(get_pointer(ptr)));
|
||||
//return node_ptr(detail::get_pointer(ptr)));
|
||||
return const_cast<node*>(detail::get_pointer(ptr));
|
||||
}
|
||||
|
||||
node_ptr get_root_node()
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -17,13 +17,11 @@
|
||||
#include <boost/intrusive/detail/config_begin.hpp>
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/intrusive/detail/utilities.hpp>
|
||||
#include <boost/intrusive/detail/pointer_type.hpp>
|
||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||
#include <boost/intrusive/detail/list_node.hpp>
|
||||
#include <boost/intrusive/circular_list_algorithms.hpp>
|
||||
#include <boost/intrusive/linking_policy.hpp>
|
||||
#include <boost/intrusive/tag.hpp>
|
||||
#include <boost/get_pointer.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <stdexcept>
|
||||
|
||||
@@ -186,8 +184,7 @@ class list_base_hook
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static this_type_ptr to_hook_ptr(node_ptr p)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return this_type_ptr(static_cast<list_base_hook*> (get_pointer(p)));
|
||||
return this_type_ptr(static_cast<list_base_hook*> (detail::get_pointer(p)));
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: Converts a const pointer to a node stored in a container into
|
||||
@@ -196,8 +193,7 @@ class list_base_hook
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static const_this_type_ptr to_hook_ptr(const_node_ptr p)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return const_this_type_ptr(static_cast<const list_base_hook*> (get_pointer(p)));
|
||||
return const_this_type_ptr(static_cast<const list_base_hook*> (detail::get_pointer(p)));
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: Returns a pointer to the node that this hook holds.
|
||||
@@ -365,8 +361,7 @@ class list_member_hook
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static this_type_ptr to_hook_ptr(node_ptr p)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return this_type_ptr(static_cast<this_type*> (get_pointer(p)));
|
||||
return this_type_ptr(static_cast<this_type*> (detail::get_pointer(p)));
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: Converts a const pointer to a node stored in a container into
|
||||
@@ -375,8 +370,7 @@ class list_member_hook
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static const_this_type_ptr to_hook_ptr(const_node_ptr p)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return const_this_type_ptr(static_cast<const this_type*> (get_pointer(p)));
|
||||
return const_this_type_ptr(static_cast<const this_type*> (detail::get_pointer(p)));
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: Returns a pointer to the node that this hook holds.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2007
|
||||
// (C) Copyright Ion Gaztanaga 2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -20,7 +20,6 @@
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/intrusive/detail/pointer_type.hpp>
|
||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||
#include <boost/intrusive/set_hook.hpp>
|
||||
#include <boost/intrusive/detail/rbtree_node.hpp>
|
||||
@@ -107,8 +106,7 @@ class rbtree
|
||||
|
||||
static node_ptr uncast(const_node_ptr ptr)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return node_ptr(const_cast<node*>(get_pointer(ptr)));
|
||||
return node_ptr(const_cast<node*>(detail::get_pointer(ptr)));
|
||||
}
|
||||
/// @endcond
|
||||
|
||||
@@ -271,9 +269,8 @@ class rbtree
|
||||
//! <b>Complexity</b>: Constant.
|
||||
static rbtree &container_from_end_iterator(iterator end_iterator)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return *detail::parent_from_member
|
||||
( members_t::this_from_node(get_pointer(end_iterator.pointed_node()))
|
||||
return *detail::parent_from_member<rbtree, members_t>
|
||||
( members_t::this_from_node(detail::get_pointer(end_iterator.pointed_node()))
|
||||
, &rbtree::members_);
|
||||
}
|
||||
|
||||
@@ -287,9 +284,8 @@ class rbtree
|
||||
//! <b>Complexity</b>: Constant.
|
||||
static const rbtree &container_from_end_iterator(const_iterator end_iterator)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return *detail::parent_from_member
|
||||
( members_t::this_from_node(get_pointer(end_iterator.pointed_node()))
|
||||
return *detail::parent_from_member<rbtree, members_t>
|
||||
( members_t::this_from_node(detail::get_pointer(end_iterator.pointed_node()))
|
||||
, &rbtree::members_);
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -43,12 +43,11 @@
|
||||
#include <iterator>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/intrusive/detail/pointer_type.hpp>
|
||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||
#include <boost/get_pointer.hpp>
|
||||
#include <boost/type_traits/alignment_of.hpp>
|
||||
#include <cstddef>
|
||||
#include <boost/detail/no_exceptions_support.hpp>
|
||||
#include <boost/interprocess/detail/utilities.hpp>
|
||||
|
||||
|
||||
namespace boost {
|
||||
@@ -916,8 +915,7 @@ class rbtree_algorithms
|
||||
private:
|
||||
static node_ptr uncast(const_node_ptr ptr)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return node_ptr(const_cast<node*>(get_pointer(ptr)));
|
||||
return node_ptr(const_cast<node*>(detail::get_pointer(ptr)));
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: z is the node to be inserted, par is its parent,
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -234,7 +234,7 @@ class set
|
||||
//! <b>Complexity</b>: Constant.
|
||||
static set &container_from_end_iterator(iterator end_iterator)
|
||||
{
|
||||
return *detail::parent_from_member
|
||||
return *detail::parent_from_member<set, tree_type>
|
||||
( &tree_type::container_from_end_iterator(end_iterator)
|
||||
, &set::tree_);
|
||||
}
|
||||
@@ -249,7 +249,7 @@ class set
|
||||
//! <b>Complexity</b>: Constant.
|
||||
static const set &container_from_end_iterator(const_iterator end_iterator)
|
||||
{
|
||||
return *detail::parent_from_member
|
||||
return *detail::parent_from_member<set, tree_type>
|
||||
( &tree_type::container_from_end_iterator(end_iterator)
|
||||
, &set::tree_);
|
||||
}
|
||||
@@ -1126,7 +1126,7 @@ class multiset
|
||||
//! <b>Complexity</b>: Constant.
|
||||
static multiset &container_from_end_iterator(iterator end_iterator)
|
||||
{
|
||||
return *detail::parent_from_member
|
||||
return *detail::parent_from_member<multiset, tree_type>
|
||||
( &tree_type::container_from_end_iterator(end_iterator)
|
||||
, &multiset::tree_);
|
||||
}
|
||||
@@ -1141,7 +1141,7 @@ class multiset
|
||||
//! <b>Complexity</b>: Constant.
|
||||
static const multiset &container_from_end_iterator(const_iterator end_iterator)
|
||||
{
|
||||
return *detail::parent_from_member
|
||||
return *detail::parent_from_member<multiset, tree_type>
|
||||
( &tree_type::container_from_end_iterator(end_iterator)
|
||||
, &multiset::tree_);
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -17,13 +17,11 @@
|
||||
#include <boost/intrusive/detail/config_begin.hpp>
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/intrusive/detail/utilities.hpp>
|
||||
#include <boost/intrusive/detail/pointer_type.hpp>
|
||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||
#include <boost/intrusive/detail/rbtree_node.hpp>
|
||||
#include <boost/intrusive/rbtree_algorithms.hpp>
|
||||
#include <boost/intrusive/linking_policy.hpp>
|
||||
#include <boost/intrusive/tag.hpp>
|
||||
#include <boost/get_pointer.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <stdexcept>
|
||||
|
||||
@@ -174,8 +172,7 @@ class set_base_hook
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static this_type_ptr to_hook_ptr(node_ptr p)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return this_type_ptr(static_cast<set_base_hook*> (get_pointer(p)));
|
||||
return this_type_ptr(static_cast<set_base_hook*> (detail::get_pointer(p)));
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: Converts a const pointer to a node stored in a container into
|
||||
@@ -184,8 +181,7 @@ class set_base_hook
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static const_this_type_ptr to_hook_ptr(const_node_ptr p)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return const_this_type_ptr(static_cast<const set_base_hook*> (get_pointer(p)));
|
||||
return const_this_type_ptr(static_cast<const set_base_hook*> (detail::get_pointer(p)));
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: Returns a pointer to the node that this hook holds.
|
||||
@@ -332,8 +328,7 @@ class set_member_hook
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static this_type_ptr to_hook_ptr(node_ptr p)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return this_type_ptr(static_cast<this_type*> (get_pointer(p)));
|
||||
return this_type_ptr(static_cast<this_type*> (detail::get_pointer(p)));
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: Converts a const pointer to a node stored in a container into
|
||||
@@ -342,8 +337,7 @@ class set_member_hook
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static const_this_type_ptr to_hook_ptr(const_node_ptr p)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return const_this_type_ptr(static_cast<const this_type*> (get_pointer(p)));
|
||||
return const_this_type_ptr(static_cast<const this_type*> (detail::get_pointer(p)));
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: Returns a pointer to the node that this hook holds.
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/intrusive/slist_hook.hpp>
|
||||
#include <boost/intrusive/circular_slist_algorithms.hpp>
|
||||
#include <boost/intrusive/detail/pointer_type.hpp>
|
||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||
#include <boost/intrusive/linking_policy.hpp>
|
||||
#include <iterator>
|
||||
@@ -112,8 +111,7 @@ class slist
|
||||
|
||||
static node_ptr uncast(const_node_ptr ptr)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return node_ptr(const_cast<node*>(get_pointer(ptr)));
|
||||
return node_ptr(const_cast<node*>(detail::get_pointer(ptr)));
|
||||
}
|
||||
|
||||
static iterator previous_node(iterator beg, iterator i)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -17,13 +17,11 @@
|
||||
#include <boost/intrusive/detail/config_begin.hpp>
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/intrusive/detail/utilities.hpp>
|
||||
#include <boost/intrusive/detail/pointer_type.hpp>
|
||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||
#include <boost/intrusive/detail/slist_node.hpp>
|
||||
#include <boost/intrusive/circular_slist_algorithms.hpp>
|
||||
#include <boost/intrusive/linking_policy.hpp>
|
||||
#include <boost/intrusive/tag.hpp>
|
||||
#include <boost/get_pointer.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <stdexcept>
|
||||
|
||||
@@ -189,8 +187,7 @@ class slist_base_hook
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static this_type_ptr to_hook_ptr(node_ptr p)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return this_type_ptr(static_cast<slist_base_hook*> (get_pointer(p)));
|
||||
return this_type_ptr(static_cast<slist_base_hook*> (detail::get_pointer(p)));
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: Converts a const pointer to a node stored in a container into
|
||||
@@ -199,8 +196,7 @@ class slist_base_hook
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static const_this_type_ptr to_hook_ptr(const_node_ptr p)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return const_this_type_ptr(static_cast<const slist_base_hook*> (get_pointer(p)));
|
||||
return const_this_type_ptr(static_cast<const slist_base_hook*> (detail::get_pointer(p)));
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: Returns a pointer to the node that this hook holds.
|
||||
@@ -372,8 +368,7 @@ class slist_member_hook
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static this_type_ptr to_hook_ptr(node_ptr p)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return this_type_ptr(static_cast<this_type*> (get_pointer(p)));
|
||||
return this_type_ptr(static_cast<this_type*> (detail::get_pointer(p)));
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: Converts a const pointer to a node stored in a container into
|
||||
@@ -382,8 +377,7 @@ class slist_member_hook
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static const_this_type_ptr to_hook_ptr(const_node_ptr p)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return const_this_type_ptr(static_cast<const this_type*> (get_pointer(p)));
|
||||
return const_this_type_ptr(static_cast<const this_type*> (detail::get_pointer(p)));
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: Returns a pointer to the node that this hook holds.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gazta<EFBFBD>aga 2006-2007
|
||||
// (C) Copyright Ion Gaztanaga 2006-2007
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -17,11 +17,9 @@
|
||||
#include <boost/intrusive/detail/config_begin.hpp>
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/intrusive/detail/utilities.hpp>
|
||||
#include <boost/intrusive/detail/pointer_type.hpp>
|
||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||
#include <boost/intrusive/slist_hook.hpp>
|
||||
#include <boost/intrusive/linking_policy.hpp>
|
||||
#include <boost/get_pointer.hpp>
|
||||
#include <stdexcept>
|
||||
|
||||
namespace boost {
|
||||
@@ -133,8 +131,7 @@ class unordered_set_base_hook
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static this_type_ptr to_hook_ptr(node_ptr p)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return this_type_ptr((this_type*)get_pointer(IsListHook::to_hook_ptr(p)));
|
||||
return this_type_ptr((this_type*)detail::get_pointer(IsListHook::to_hook_ptr(p)));
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: Converts a const pointer to a node stored in a container into
|
||||
@@ -143,8 +140,7 @@ class unordered_set_base_hook
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static const_this_type_ptr to_hook_ptr(const_node_ptr p)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return const_this_type_ptr((const this_type*)get_pointer(IsListHook::to_hook_ptr(p)));
|
||||
return const_this_type_ptr((const this_type*)detail::get_pointer(IsListHook::to_hook_ptr(p)));
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: Returns a pointer to the node that this hook holds.
|
||||
@@ -262,8 +258,7 @@ class unordered_set_member_hook
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static this_type_ptr to_hook_ptr(node_ptr p)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return this_type_ptr((this_type*)get_pointer(IsListHook::to_hook_ptr(p)));
|
||||
return this_type_ptr((this_type*)detail::get_pointer(IsListHook::to_hook_ptr(p)));
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: Converts a const pointer to a node stored in a container into
|
||||
@@ -272,8 +267,7 @@ class unordered_set_member_hook
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static const_this_type_ptr to_hook_ptr(const_node_ptr p)
|
||||
{
|
||||
using boost::get_pointer;
|
||||
return const_this_type_ptr((const this_type*)get_pointer(IsListHook::to_hook_ptr(p)));
|
||||
return const_this_type_ptr((const this_type*)detail::get_pointer(IsListHook::to_hook_ptr(p)));
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: Returns a pointer to the node that this hook holds.
|
||||
|
Reference in New Issue
Block a user