update boost
This commit is contained in:
@@ -49,13 +49,13 @@ struct any_list_node_traits
|
||||
typedef typename node::node_ptr node_ptr;
|
||||
typedef typename node::const_node_ptr const_node_ptr;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const_node_ptr n)
|
||||
{ return n->node_ptr_1; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_next(node_ptr n, node_ptr next)
|
||||
{ n->node_ptr_1 = next; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous(const_node_ptr n)
|
||||
{ return n->node_ptr_2; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_previous(node_ptr n, node_ptr prev)
|
||||
@@ -70,7 +70,7 @@ struct any_slist_node_traits
|
||||
typedef typename node::node_ptr node_ptr;
|
||||
typedef typename node::const_node_ptr const_node_ptr;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const_node_ptr n)
|
||||
{ return n->node_ptr_1; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_next(node_ptr n, node_ptr next)
|
||||
@@ -90,22 +90,22 @@ struct any_unordered_node_traits
|
||||
static const bool store_hash = true;
|
||||
static const bool optimize_multikey = true;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const_node_ptr n)
|
||||
{ return n->node_ptr_1; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_next(node_ptr n, node_ptr next)
|
||||
{ n->node_ptr_1 = next; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_prev_in_group(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_prev_in_group(const_node_ptr n)
|
||||
{ return n->node_ptr_2; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_prev_in_group(node_ptr n, node_ptr prev)
|
||||
{ n->node_ptr_2 = prev; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static std::size_t get_hash(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static std::size_t get_hash(const_node_ptr n)
|
||||
{ return n->size_t_1; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_hash(const node_ptr & n, std::size_t h)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_hash(node_ptr n, std::size_t h)
|
||||
{ n->size_t_1 = h; }
|
||||
};
|
||||
|
||||
@@ -119,28 +119,28 @@ struct any_rbtree_node_traits
|
||||
|
||||
typedef std::size_t color;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const_node_ptr n)
|
||||
{ return n->node_ptr_1; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(node_ptr n, node_ptr p)
|
||||
{ n->node_ptr_1 = p; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const_node_ptr n)
|
||||
{ return n->node_ptr_2; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(node_ptr n, node_ptr l)
|
||||
{ n->node_ptr_2 = l; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const_node_ptr n)
|
||||
{ return n->node_ptr_3; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(node_ptr n, node_ptr r)
|
||||
{ n->node_ptr_3 = r; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static color get_color(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static color get_color(const_node_ptr n)
|
||||
{ return n->size_t_1; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_color(const node_ptr & n, color c)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_color(node_ptr n, color c)
|
||||
{ n->size_t_1 = c; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static color black()
|
||||
@@ -160,28 +160,28 @@ struct any_avltree_node_traits
|
||||
|
||||
typedef std::size_t balance;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const_node_ptr n)
|
||||
{ return n->node_ptr_1; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(node_ptr n, node_ptr p)
|
||||
{ n->node_ptr_1 = p; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const_node_ptr n)
|
||||
{ return n->node_ptr_2; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(node_ptr n, node_ptr l)
|
||||
{ n->node_ptr_2 = l; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const_node_ptr n)
|
||||
{ return n->node_ptr_3; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(node_ptr n, node_ptr r)
|
||||
{ n->node_ptr_3 = r; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static balance get_balance(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static balance get_balance(const_node_ptr n)
|
||||
{ return n->size_t_1; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_balance(const node_ptr & n, balance b)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_balance(node_ptr n, balance b)
|
||||
{ n->size_t_1 = b; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static balance negative()
|
||||
@@ -202,19 +202,19 @@ struct any_tree_node_traits
|
||||
typedef typename node::node_ptr node_ptr;
|
||||
typedef typename node::const_node_ptr const_node_ptr;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const_node_ptr n)
|
||||
{ return n->node_ptr_1; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(node_ptr n, node_ptr p)
|
||||
{ n->node_ptr_1 = p; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const_node_ptr n)
|
||||
{ return n->node_ptr_2; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(node_ptr n, node_ptr l)
|
||||
{ n->node_ptr_2 = l; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const_node_ptr n)
|
||||
{ return n->node_ptr_3; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(node_ptr n, node_ptr r)
|
||||
@@ -243,7 +243,7 @@ class any_algorithms
|
||||
typedef typename node::const_node_ptr const_node_ptr;
|
||||
typedef any_node_traits<VoidPointer> node_traits;
|
||||
|
||||
//! <b>Requires</b>: node must not be part of any tree.
|
||||
//! <b>Requires</b>: 'n' must not be part of any tree.
|
||||
//!
|
||||
//! <b>Effects</b>: After the function unique(node) == true.
|
||||
//!
|
||||
@@ -252,27 +252,27 @@ class any_algorithms
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void init(const node_ptr & node)
|
||||
{ node->node_ptr_1 = node_ptr(); };
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void init(node_ptr n) BOOST_NOEXCEPT
|
||||
{ n->node_ptr_1 = node_ptr(); };
|
||||
|
||||
//! <b>Effects</b>: Returns true if node is in the same state as if called init(node)
|
||||
//! <b>Effects</b>: Returns true if 'n' is in the same state as if called init(node)
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
BOOST_INTRUSIVE_FORCEINLINE static bool inited(const const_node_ptr & node)
|
||||
{ return !node->node_ptr_1; };
|
||||
BOOST_INTRUSIVE_FORCEINLINE static bool inited(const_node_ptr n)
|
||||
{ return !n->node_ptr_1; };
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static bool unique(const const_node_ptr & node)
|
||||
{ return !node->node_ptr_1; }
|
||||
BOOST_INTRUSIVE_FORCEINLINE static bool unique(const_node_ptr n) BOOST_NOEXCEPT
|
||||
{ return !n->node_ptr_1; }
|
||||
|
||||
static void unlink(const node_ptr &)
|
||||
static void unlink(node_ptr)
|
||||
{
|
||||
//Auto-unlink hooks and unlink() are not available for any hooks
|
||||
any_algorithms<VoidPointer>::template function_not_available_for_any_hooks<node_ptr>();
|
||||
}
|
||||
|
||||
static void swap_nodes(const node_ptr &, const node_ptr &)
|
||||
static void swap_nodes(node_ptr, node_ptr)
|
||||
{
|
||||
//Any nodes have no swap_nodes capability because they don't know
|
||||
//what algorithm they must use to unlink the node from the container
|
||||
|
||||
@@ -22,7 +22,9 @@
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/core/no_exceptions_support.hpp>
|
||||
#include <boost/intrusive/detail/workaround.hpp>
|
||||
#include <boost/move/detail/placement_new.hpp>
|
||||
#include <boost/move/detail/force_ptr.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
@@ -53,20 +55,20 @@ class array_initializer
|
||||
{
|
||||
char *init_buf = (char*)rawbuf;
|
||||
std::size_t i = 0;
|
||||
BOOST_TRY{
|
||||
BOOST_INTRUSIVE_TRY{
|
||||
for(; i != N; ++i){
|
||||
new(init_buf)T(init);
|
||||
::new(init_buf, boost_move_new_t()) T(init);
|
||||
init_buf += sizeof(T);
|
||||
}
|
||||
}
|
||||
BOOST_CATCH(...){
|
||||
BOOST_INTRUSIVE_CATCH(...){
|
||||
while(i--){
|
||||
init_buf -= sizeof(T);
|
||||
((T*)init_buf)->~T();
|
||||
move_detail::force_ptr<T*>(init_buf)->~T();
|
||||
}
|
||||
BOOST_RETHROW;
|
||||
BOOST_INTRUSIVE_RETHROW;
|
||||
}
|
||||
BOOST_CATCH_END
|
||||
BOOST_INTRUSIVE_CATCH_END
|
||||
}
|
||||
|
||||
operator T* ()
|
||||
@@ -80,7 +82,7 @@ class array_initializer
|
||||
char *init_buf = (char*)rawbuf + N*sizeof(T);
|
||||
for(std::size_t i = 0; i != N; ++i){
|
||||
init_buf -= sizeof(T);
|
||||
((T*)init_buf)->~T();
|
||||
move_detail::force_ptr<T*>(init_buf)->~T();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,40 +69,40 @@ struct default_avltree_node_traits_impl
|
||||
|
||||
typedef typename node::balance balance;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const_node_ptr n)
|
||||
{ return n->parent_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(node_ptr n)
|
||||
{ return n->parent_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(node_ptr n, node_ptr p)
|
||||
{ n->parent_ = p; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const_node_ptr n)
|
||||
{ return n->left_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(node_ptr n)
|
||||
{ return n->left_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(node_ptr n, node_ptr l)
|
||||
{ n->left_ = l; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const_node_ptr n)
|
||||
{ return n->right_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(node_ptr n)
|
||||
{ return n->right_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(node_ptr n, node_ptr r)
|
||||
{ n->right_ = r; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static balance get_balance(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static balance get_balance(const_node_ptr n)
|
||||
{ return n->balance_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static balance get_balance(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static balance get_balance(node_ptr n)
|
||||
{ return n->balance_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_balance(const node_ptr & n, balance b)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_balance(node_ptr n, balance b)
|
||||
{ n->balance_ = b; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static balance negative()
|
||||
@@ -127,28 +127,28 @@ struct compact_avltree_node_traits_impl
|
||||
|
||||
typedef pointer_plus_bits<node_ptr, 2> ptr_bit;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const_node_ptr n)
|
||||
{ return ptr_bit::get_pointer(n->parent_); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(node_ptr n, node_ptr p)
|
||||
{ ptr_bit::set_pointer(n->parent_, p); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const_node_ptr n)
|
||||
{ return n->left_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(node_ptr n, node_ptr l)
|
||||
{ n->left_ = l; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const_node_ptr n)
|
||||
{ return n->right_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(node_ptr n, node_ptr r)
|
||||
{ n->right_ = r; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static balance get_balance(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static balance get_balance(const_node_ptr n)
|
||||
{ return (balance)ptr_bit::get_bits(n->parent_); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_balance(const node_ptr & n, balance b)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_balance(node_ptr n, balance b)
|
||||
{ ptr_bit::set_bits(n->parent_, (std::size_t)b); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static balance negative()
|
||||
|
||||
@@ -35,21 +35,20 @@ class bstree_algorithms_base
|
||||
typedef typename NodeTraits::node_ptr node_ptr;
|
||||
typedef typename NodeTraits::const_node_ptr const_node_ptr;
|
||||
|
||||
//! <b>Requires</b>: 'node' is a node from the tree except the header.
|
||||
//! <b>Requires</b>: 'n' is a node from the tree except the header.
|
||||
//!
|
||||
//! <b>Effects</b>: Returns the next node of the tree.
|
||||
//!
|
||||
//! <b>Complexity</b>: Average constant time.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static node_ptr next_node(const node_ptr & node)
|
||||
static node_ptr next_node(node_ptr n) BOOST_NOEXCEPT
|
||||
{
|
||||
node_ptr const n_right(NodeTraits::get_right(node));
|
||||
node_ptr const n_right(NodeTraits::get_right(n));
|
||||
if(n_right){
|
||||
return minimum(n_right);
|
||||
}
|
||||
else {
|
||||
node_ptr n(node);
|
||||
node_ptr p(NodeTraits::get_parent(n));
|
||||
while(n == NodeTraits::get_right(p)){
|
||||
n = p;
|
||||
@@ -59,24 +58,23 @@ class bstree_algorithms_base
|
||||
}
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: 'node' is a node from the tree except the leftmost node.
|
||||
//! <b>Requires</b>: 'n' is a node from the tree except the leftmost node.
|
||||
//!
|
||||
//! <b>Effects</b>: Returns the previous node of the tree.
|
||||
//!
|
||||
//! <b>Complexity</b>: Average constant time.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static node_ptr prev_node(const node_ptr & node)
|
||||
static node_ptr prev_node(node_ptr n) BOOST_NOEXCEPT
|
||||
{
|
||||
if(is_header(node)){
|
||||
//return NodeTraits::get_right(node);
|
||||
return maximum(NodeTraits::get_parent(node));
|
||||
if(is_header(n)){
|
||||
return NodeTraits::get_right(n);
|
||||
}
|
||||
else if(NodeTraits::get_left(node)){
|
||||
return maximum(NodeTraits::get_left(node));
|
||||
else if(NodeTraits::get_left(n)){
|
||||
return maximum(NodeTraits::get_left(n));
|
||||
}
|
||||
else {
|
||||
node_ptr p(node);
|
||||
node_ptr p(n);
|
||||
node_ptr x = NodeTraits::get_parent(p);
|
||||
while(p == NodeTraits::get_left(x)){
|
||||
p = x;
|
||||
@@ -86,38 +84,38 @@ class bstree_algorithms_base
|
||||
}
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: 'node' is a node of a tree but not the header.
|
||||
//! <b>Requires</b>: 'n' is a node of a tree but not the header.
|
||||
//!
|
||||
//! <b>Effects</b>: Returns the minimum node of the subtree starting at p.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic to the size of the subtree.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static node_ptr minimum(node_ptr node)
|
||||
static node_ptr minimum(node_ptr n)
|
||||
{
|
||||
for(node_ptr p_left = NodeTraits::get_left(node)
|
||||
for(node_ptr p_left = NodeTraits::get_left(n)
|
||||
;p_left
|
||||
;p_left = NodeTraits::get_left(node)){
|
||||
node = p_left;
|
||||
;p_left = NodeTraits::get_left(n)){
|
||||
n = p_left;
|
||||
}
|
||||
return node;
|
||||
return n;
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: 'node' is a node of a tree but not the header.
|
||||
//! <b>Requires</b>: 'n' is a node of a tree but not the header.
|
||||
//!
|
||||
//! <b>Effects</b>: Returns the maximum node of the subtree starting at p.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic to the size of the subtree.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static node_ptr maximum(node_ptr node)
|
||||
static node_ptr maximum(node_ptr n)
|
||||
{
|
||||
for(node_ptr p_right = NodeTraits::get_right(node)
|
||||
for(node_ptr p_right = NodeTraits::get_right(n)
|
||||
;p_right
|
||||
;p_right = NodeTraits::get_right(node)){
|
||||
node = p_right;
|
||||
;p_right = NodeTraits::get_right(n)){
|
||||
n = p_right;
|
||||
}
|
||||
return node;
|
||||
return n;
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: p is a node of a tree.
|
||||
@@ -127,7 +125,7 @@ class bstree_algorithms_base
|
||||
//! <b>Complexity</b>: Constant.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static bool is_header(const const_node_ptr & p)
|
||||
static bool is_header(const_node_ptr p) BOOST_NOEXCEPT
|
||||
{
|
||||
node_ptr p_left (NodeTraits::get_left(p));
|
||||
node_ptr p_right(NodeTraits::get_right(p));
|
||||
@@ -144,37 +142,37 @@ class bstree_algorithms_base
|
||||
return false;
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: 'node' is a node of the tree or a header node.
|
||||
//! <b>Requires</b>: 'n' is a node of the tree or a header node.
|
||||
//!
|
||||
//! <b>Effects</b>: Returns the header of the tree.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static node_ptr get_header(const const_node_ptr & node)
|
||||
static node_ptr get_header(const_node_ptr n)
|
||||
{
|
||||
node_ptr n(detail::uncast(node));
|
||||
node_ptr p(NodeTraits::get_parent(node));
|
||||
//If p is null, then n is the header of an empty tree
|
||||
node_ptr nn(detail::uncast(n));
|
||||
node_ptr p(NodeTraits::get_parent(n));
|
||||
//If p is null, then nn is the header of an empty tree
|
||||
if(p){
|
||||
//Non-empty tree, check if n is neither root nor header
|
||||
//Non-empty tree, check if nn is neither root nor header
|
||||
node_ptr pp(NodeTraits::get_parent(p));
|
||||
//If granparent is not equal to n, then n is neither root nor header,
|
||||
//If granparent is not equal to nn, then nn is neither root nor header,
|
||||
//the try the fast path
|
||||
if(n != pp){
|
||||
if(nn != pp){
|
||||
do{
|
||||
n = p;
|
||||
nn = p;
|
||||
p = pp;
|
||||
pp = NodeTraits::get_parent(pp);
|
||||
}while(n != pp);
|
||||
n = p;
|
||||
}while(nn != pp);
|
||||
nn = p;
|
||||
}
|
||||
//Check if n is root or header when size() > 0
|
||||
else if(!bstree_algorithms_base::is_header(n)){
|
||||
n = p;
|
||||
//Check if nn is root or header when size() > 0
|
||||
else if(!bstree_algorithms_base::is_header(nn)){
|
||||
nn = p;
|
||||
}
|
||||
}
|
||||
return n;
|
||||
return nn;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
#endif
|
||||
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/intrusive/detail/workaround.hpp>
|
||||
#include <boost/intrusive/detail/assert.hpp>
|
||||
#include <boost/intrusive/detail/algo_type.hpp>
|
||||
#include <boost/core/no_exceptions_support.hpp>
|
||||
#include <cstddef>
|
||||
|
||||
namespace boost {
|
||||
@@ -40,7 +40,7 @@ class common_slist_algorithms
|
||||
typedef typename NodeTraits::const_node_ptr const_node_ptr;
|
||||
typedef NodeTraits node_traits;
|
||||
|
||||
static node_ptr get_previous_node(node_ptr p, const node_ptr & this_node)
|
||||
static node_ptr get_previous_node(node_ptr p, node_ptr this_node)
|
||||
{
|
||||
for( node_ptr p_next
|
||||
; this_node != (p_next = NodeTraits::get_next(p))
|
||||
@@ -52,41 +52,41 @@ class common_slist_algorithms
|
||||
return p;
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void init(node_ptr this_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void init(node_ptr this_node) BOOST_NOEXCEPT
|
||||
{ NodeTraits::set_next(this_node, node_ptr()); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static bool unique(const const_node_ptr & this_node)
|
||||
static bool unique(const_node_ptr this_node) BOOST_NOEXCEPT
|
||||
{
|
||||
node_ptr next = NodeTraits::get_next(this_node);
|
||||
return !next || next == this_node;
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static bool inited(const const_node_ptr & this_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static bool inited(const_node_ptr this_node) BOOST_NOEXCEPT
|
||||
{ return !NodeTraits::get_next(this_node); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void unlink_after(node_ptr prev_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void unlink_after(node_ptr prev_node) BOOST_NOEXCEPT
|
||||
{
|
||||
const_node_ptr this_node(NodeTraits::get_next(prev_node));
|
||||
NodeTraits::set_next(prev_node, NodeTraits::get_next(this_node));
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void unlink_after(node_ptr prev_node, node_ptr last_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void unlink_after(node_ptr prev_node, node_ptr last_node) BOOST_NOEXCEPT
|
||||
{ NodeTraits::set_next(prev_node, last_node); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void link_after(node_ptr prev_node, node_ptr this_node)
|
||||
static void link_after(node_ptr prev_node, node_ptr this_node) BOOST_NOEXCEPT
|
||||
{
|
||||
NodeTraits::set_next(this_node, NodeTraits::get_next(prev_node));
|
||||
NodeTraits::set_next(prev_node, this_node);
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void incorporate_after(node_ptr bp, node_ptr b, node_ptr be)
|
||||
static void incorporate_after(node_ptr bp, node_ptr b, node_ptr be) BOOST_NOEXCEPT
|
||||
{
|
||||
node_ptr p(NodeTraits::get_next(bp));
|
||||
NodeTraits::set_next(bp, b);
|
||||
NodeTraits::set_next(be, p);
|
||||
}
|
||||
|
||||
static void transfer_after(node_ptr bp, node_ptr bb, node_ptr be)
|
||||
static void transfer_after(node_ptr bp, node_ptr bb, node_ptr be) BOOST_NOEXCEPT
|
||||
{
|
||||
if (bp != bb && bp != be && bb != be) {
|
||||
node_ptr next_b = NodeTraits::get_next(bb);
|
||||
@@ -126,7 +126,7 @@ class common_slist_algorithms
|
||||
new_f = cur;
|
||||
bcur = cur;
|
||||
cur = node_traits::get_next(cur);
|
||||
BOOST_TRY{
|
||||
BOOST_INTRUSIVE_TRY{
|
||||
//Main loop
|
||||
while(cur != end){
|
||||
if(pred(cur)){ //Might throw
|
||||
@@ -145,11 +145,11 @@ class common_slist_algorithms
|
||||
}
|
||||
}
|
||||
}
|
||||
BOOST_CATCH(...){
|
||||
BOOST_INTRUSIVE_CATCH(...){
|
||||
node_traits::set_next(last_to_remove, new_f);
|
||||
BOOST_RETHROW;
|
||||
BOOST_INTRUSIVE_RETHROW;
|
||||
}
|
||||
BOOST_CATCH_END
|
||||
BOOST_INTRUSIVE_CATCH_END
|
||||
node_traits::set_next(last_to_remove, new_f);
|
||||
break;
|
||||
}
|
||||
@@ -167,7 +167,7 @@ class common_slist_algorithms
|
||||
//! <b>Complexity</b>: Linear
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static std::size_t distance(const const_node_ptr &f, const const_node_ptr &l)
|
||||
static std::size_t distance(const_node_ptr f, const_node_ptr l) BOOST_NOEXCEPT
|
||||
{
|
||||
const_node_ptr i(f);
|
||||
std::size_t result = 0;
|
||||
@@ -177,6 +177,75 @@ class common_slist_algorithms
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: "disposer" must be an object function
|
||||
//! taking a node_ptr parameter and shouldn't throw.
|
||||
//!
|
||||
//! <b>Effects</b>: Calls
|
||||
//! <tt>void disposer::operator()(node_ptr)</tt> for every node of the list
|
||||
//! [p, e).
|
||||
//!
|
||||
//! <b>Returns</b>: The number of unlinked/disposed nodes
|
||||
//!
|
||||
//! <b>Complexity</b>: Linear to the number of element of the list.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
template<class Disposer>
|
||||
static std::size_t unlink_after_and_dispose(node_ptr bb, node_ptr e, Disposer disposer) BOOST_NOEXCEPT
|
||||
{
|
||||
std::size_t n = 0u;
|
||||
node_ptr i = node_traits::get_next(bb);
|
||||
while (i != e) {
|
||||
node_ptr to_erase(i);
|
||||
i = node_traits::get_next(i);
|
||||
disposer(to_erase);
|
||||
++n;
|
||||
}
|
||||
node_traits::set_next(bb, e);
|
||||
return n;
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: "disposer" must be an object function
|
||||
//! taking a node_ptr parameter and shouldn't throw.
|
||||
//!
|
||||
//! <b>Effects</b>: Calls
|
||||
//! <tt>void disposer::operator()(node_ptr)</tt> for every node of the list
|
||||
//! after p (but not for p). Works for circular or linear lists
|
||||
//!
|
||||
//! <b>Complexity</b>: Linear to the number of element of the list.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
template<class Disposer>
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void unlink_after_and_dispose(node_ptr bb, Disposer disposer) BOOST_NOEXCEPT
|
||||
{
|
||||
node_ptr i = node_traits::get_next(bb);
|
||||
node_traits::set_next(bb, node_traits::get_next(i));
|
||||
disposer(i);
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: "disposer" must be an object function
|
||||
//! taking a node_ptr parameter and shouldn't throw.
|
||||
//!
|
||||
//! <b>Effects</b>: Unlinks all nodes reachable from p (but not p) and calls
|
||||
//! <tt>void disposer::operator()(node_ptr)</tt> for every node of the list
|
||||
//! where p is linked.
|
||||
//!
|
||||
//! <b>Complexity</b>: Linear to the number of element of the list.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
template<class Disposer>
|
||||
static std::size_t detach_and_dispose(node_ptr p, Disposer disposer) BOOST_NOEXCEPT
|
||||
{
|
||||
std::size_t n = 0;
|
||||
node_ptr i = node_traits::get_next(p);
|
||||
while ( i != p || i != node_ptr() ) {
|
||||
node_ptr to_erase(i);
|
||||
i = node_traits::get_next(i);
|
||||
disposer(to_erase);
|
||||
}
|
||||
node_traits::set_next(p, i);
|
||||
return n;
|
||||
}
|
||||
};
|
||||
|
||||
/// @endcond
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#ifdef BOOST_MSVC
|
||||
|
||||
#pragma warning (push)
|
||||
#pragma warning (disable : 4619) // there is no warning number 'XXXX'
|
||||
#pragma warning (disable : 4275) // non DLL-interface classkey "identifier" used as base for DLL-interface classkey "identifier"
|
||||
#pragma warning (disable : 4251) // "identifier" : class "type" needs to have dll-interface to be used by clients of class "type2"
|
||||
#pragma warning (disable : 4675) // "method" should be declared "static" and have exactly one parameter
|
||||
|
||||
@@ -47,7 +47,7 @@ struct default_header_holder : public NodeTraits::node
|
||||
{ return pointer_traits< node_ptr >::pointer_to(*static_cast< node* >(this)); }
|
||||
|
||||
// (unsafe) downcast used to implement container-from-iterator
|
||||
BOOST_INTRUSIVE_FORCEINLINE static default_header_holder* get_holder(const node_ptr &p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static default_header_holder* get_holder(node_ptr p)
|
||||
{ return static_cast< default_header_holder* >(boost::movelib::to_raw_pointer(p)); }
|
||||
};
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ struct empty_node_checker
|
||||
|
||||
struct return_type {};
|
||||
|
||||
void operator () (const const_node_ptr&, const return_type&, const return_type&, return_type&) {}
|
||||
void operator () (const_node_ptr, const return_type&, const return_type&, return_type&) {}
|
||||
};
|
||||
|
||||
} //namespace detail{
|
||||
|
||||
@@ -52,37 +52,6 @@ class exception_disposer
|
||||
}
|
||||
};
|
||||
|
||||
template<class Container, class Disposer, class SizeType>
|
||||
class exception_array_disposer
|
||||
{
|
||||
Container *cont_;
|
||||
Disposer &disp_;
|
||||
SizeType &constructed_;
|
||||
|
||||
exception_array_disposer(const exception_array_disposer&);
|
||||
exception_array_disposer &operator=(const exception_array_disposer&);
|
||||
|
||||
public:
|
||||
|
||||
exception_array_disposer
|
||||
(Container &cont, Disposer &disp, SizeType &constructed)
|
||||
: cont_(&cont), disp_(disp), constructed_(constructed)
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE void release()
|
||||
{ cont_ = 0; }
|
||||
|
||||
~exception_array_disposer()
|
||||
{
|
||||
SizeType n = constructed_;
|
||||
if(cont_){
|
||||
while(n--){
|
||||
cont_[n].clear_and_dispose(disp_);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} //namespace detail{
|
||||
} //namespace intrusive{
|
||||
} //namespace boost{
|
||||
|
||||
@@ -41,7 +41,7 @@ struct link_dispatch
|
||||
{};
|
||||
|
||||
template<class Hook>
|
||||
void destructor_impl(Hook &hook, detail::link_dispatch<safe_link>)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void destructor_impl(Hook &hook, detail::link_dispatch<safe_link>)
|
||||
{ //If this assertion raises, you might have destroyed an object
|
||||
//while it was still inserted in a container that is alive.
|
||||
//If so, remove the object from the container before destroying it.
|
||||
@@ -49,11 +49,11 @@ void destructor_impl(Hook &hook, detail::link_dispatch<safe_link>)
|
||||
}
|
||||
|
||||
template<class Hook>
|
||||
void destructor_impl(Hook &hook, detail::link_dispatch<auto_unlink>)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void destructor_impl(Hook &hook, detail::link_dispatch<auto_unlink>)
|
||||
{ hook.unlink(); }
|
||||
|
||||
template<class Hook>
|
||||
void destructor_impl(Hook &, detail::link_dispatch<normal_link>)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void destructor_impl(Hook &, detail::link_dispatch<normal_link>)
|
||||
{}
|
||||
|
||||
} //namespace detail {
|
||||
@@ -161,30 +161,30 @@ class generic_hook
|
||||
< NodeTraits
|
||||
, Tag, LinkMode, BaseHookType> hooktags;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr this_ptr()
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr this_ptr() BOOST_NOEXCEPT
|
||||
{ return pointer_traits<node_ptr>::pointer_to(static_cast<node&>(*this)); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE const_node_ptr this_ptr() const
|
||||
BOOST_INTRUSIVE_FORCEINLINE const_node_ptr this_ptr() const BOOST_NOEXCEPT
|
||||
{ return pointer_traits<const_node_ptr>::pointer_to(static_cast<const node&>(*this)); }
|
||||
|
||||
public:
|
||||
/// @endcond
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE generic_hook()
|
||||
BOOST_INTRUSIVE_FORCEINLINE generic_hook() BOOST_NOEXCEPT
|
||||
{
|
||||
if(hooktags::safemode_or_autounlink){
|
||||
node_algorithms::init(this->this_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE generic_hook(const generic_hook& )
|
||||
BOOST_INTRUSIVE_FORCEINLINE generic_hook(const generic_hook& ) BOOST_NOEXCEPT
|
||||
{
|
||||
if(hooktags::safemode_or_autounlink){
|
||||
node_algorithms::init(this->this_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE generic_hook& operator=(const generic_hook& )
|
||||
BOOST_INTRUSIVE_FORCEINLINE generic_hook& operator=(const generic_hook& ) BOOST_NOEXCEPT
|
||||
{ return *this; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE ~generic_hook()
|
||||
@@ -193,20 +193,20 @@ class generic_hook
|
||||
(*this, detail::link_dispatch<hooktags::link_mode>());
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE void swap_nodes(generic_hook &other)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void swap_nodes(generic_hook &other) BOOST_NOEXCEPT
|
||||
{
|
||||
node_algorithms::swap_nodes
|
||||
(this->this_ptr(), other.this_ptr());
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE bool is_linked() const
|
||||
BOOST_INTRUSIVE_FORCEINLINE bool is_linked() const BOOST_NOEXCEPT
|
||||
{
|
||||
//is_linked() can be only used in safe-mode or auto-unlink
|
||||
BOOST_STATIC_ASSERT(( hooktags::safemode_or_autounlink ));
|
||||
return !node_algorithms::unique(this->this_ptr());
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE void unlink()
|
||||
BOOST_INTRUSIVE_FORCEINLINE void unlink() BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_STATIC_ASSERT(( (int)hooktags::link_mode == (int)auto_unlink ));
|
||||
node_ptr n(this->this_ptr());
|
||||
|
||||
92
linx64/include/boost/intrusive/detail/hash_combine.hpp
Normal file
92
linx64/include/boost/intrusive/detail/hash_combine.hpp
Normal file
@@ -0,0 +1,92 @@
|
||||
// Copyright 2005-2014 Daniel James.
|
||||
// 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)
|
||||
//
|
||||
// Based on Peter Dimov's proposal
|
||||
// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
|
||||
// issue 6.18.
|
||||
//
|
||||
// This also contains public domain code from MurmurHash. From the
|
||||
// MurmurHash header:
|
||||
//
|
||||
// MurmurHash3 was written by Austin Appleby, and is placed in the public
|
||||
// domain. The author hereby disclaims copyright to this source code.
|
||||
//
|
||||
// Copyright 2021 Ion Gaztanaga
|
||||
// Refactored the original boost/container_hash/hash.hpp to avoid
|
||||
// any heavy std header dependencies to just combine two hash
|
||||
// values represented in a std::size_t type.
|
||||
|
||||
#ifndef BOOST_INTRUSIVE_DETAIL_HASH_COMBINE_HPP
|
||||
#define BOOST_INTRUSIVE_DETAIL_HASH_COMBINE_HPP
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
# include <boost/config.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# include <stdlib.h>
|
||||
# define BOOST_INTRUSIVE_HASH_ROTL32(x, r) _rotl(x,r)
|
||||
#else
|
||||
# define BOOST_INTRUSIVE_HASH_ROTL32(x, r) (x << r) | (x >> (32 - r))
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
namespace detail {
|
||||
|
||||
template <typename SizeT>
|
||||
inline void hash_combine_size_t(SizeT& seed, SizeT value)
|
||||
{
|
||||
seed ^= value + 0x9e3779b9 + (seed<<6) + (seed>>2);
|
||||
}
|
||||
|
||||
inline void hash_combine_size_t(boost::uint32_t& h1, boost::uint32_t k1)
|
||||
{
|
||||
const uint32_t c1 = 0xcc9e2d51;
|
||||
const uint32_t c2 = 0x1b873593;
|
||||
|
||||
k1 *= c1;
|
||||
k1 = BOOST_INTRUSIVE_HASH_ROTL32(k1,15);
|
||||
k1 *= c2;
|
||||
|
||||
h1 ^= k1;
|
||||
h1 = BOOST_INTRUSIVE_HASH_ROTL32(h1,13);
|
||||
h1 = h1*5+0xe6546b64;
|
||||
}
|
||||
|
||||
|
||||
// Don't define 64-bit hash combine on platforms without 64 bit integers,
|
||||
// and also not for 32-bit gcc as it warns about the 64-bit constant.
|
||||
#if !defined(BOOST_NO_INT64_T) && \
|
||||
!(defined(__GNUC__) && ULONG_MAX == 0xffffffff)
|
||||
inline void hash_combine_size_t(boost::uint64_t& h, boost::uint64_t k)
|
||||
{
|
||||
const boost::uint64_t m = UINT64_C(0xc6a4a7935bd1e995);
|
||||
const int r = 47;
|
||||
|
||||
k *= m;
|
||||
k ^= k >> r;
|
||||
k *= m;
|
||||
|
||||
h ^= k;
|
||||
h *= m;
|
||||
|
||||
// Completely arbitrary number, to prevent 0's
|
||||
// from hashing to 0.
|
||||
h += 0xe6546b64;
|
||||
}
|
||||
|
||||
#endif // BOOST_NO_INT64_T
|
||||
|
||||
} //namespace detail {
|
||||
} //namespace intrusive {
|
||||
} //namespace boost {
|
||||
|
||||
#endif //BOOST_INTRUSIVE_DETAIL_HASH_COMBINE_HPP
|
||||
@@ -26,7 +26,10 @@
|
||||
#include <boost/intrusive/pointer_traits.hpp>
|
||||
#include <boost/intrusive/detail/mpl.hpp>
|
||||
#include <boost/intrusive/trivial_value_traits.hpp>
|
||||
#include <boost/intrusive/slist.hpp> //make_slist
|
||||
#include <boost/intrusive/detail/common_slist_algorithms.hpp>
|
||||
#include <boost/intrusive/detail/iiterator.hpp>
|
||||
#include <boost/intrusive/detail/slist_iterator.hpp>
|
||||
#include <boost/move/detail/to_raw_pointer.hpp>
|
||||
#include <cstddef>
|
||||
#include <climits>
|
||||
#include <boost/move/core.hpp>
|
||||
@@ -35,10 +38,20 @@
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
|
||||
template <class Slist>
|
||||
struct bucket_impl : public Slist
|
||||
template <class NodeTraits>
|
||||
struct bucket_impl
|
||||
: public NodeTraits::node
|
||||
{
|
||||
typedef Slist slist_type;
|
||||
public:
|
||||
typedef NodeTraits node_traits;
|
||||
|
||||
private:
|
||||
typedef typename node_traits::node_ptr node_ptr;
|
||||
typedef typename node_traits::const_node_ptr const_node_ptr;
|
||||
|
||||
typedef detail::common_slist_algorithms<NodeTraits> algo_t;
|
||||
|
||||
public:
|
||||
BOOST_INTRUSIVE_FORCEINLINE bucket_impl()
|
||||
{}
|
||||
|
||||
@@ -46,68 +59,22 @@ struct bucket_impl : public Slist
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE ~bucket_impl()
|
||||
{
|
||||
//This bucket is still being used!
|
||||
BOOST_INTRUSIVE_INVARIANT_ASSERT(Slist::empty());
|
||||
}
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE bucket_impl &operator=(const bucket_impl&)
|
||||
{
|
||||
//This bucket is still in use!
|
||||
BOOST_INTRUSIVE_INVARIANT_ASSERT(Slist::empty());
|
||||
return *this;
|
||||
}
|
||||
{ return *this; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr get_node_ptr()
|
||||
{ return pointer_traits<node_ptr>::pointer_to(*this); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE const_node_ptr get_node_ptr() const
|
||||
{ return pointer_traits<const_node_ptr>::pointer_to(*this); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr begin_ptr()
|
||||
{ return node_traits::get_next(get_node_ptr()); }
|
||||
};
|
||||
|
||||
template<class Slist>
|
||||
struct bucket_traits_impl
|
||||
{
|
||||
private:
|
||||
BOOST_COPYABLE_AND_MOVABLE(bucket_traits_impl)
|
||||
|
||||
public:
|
||||
/// @cond
|
||||
|
||||
typedef typename pointer_traits
|
||||
<typename Slist::pointer>::template rebind_pointer
|
||||
< bucket_impl<Slist> >::type bucket_ptr;
|
||||
typedef Slist slist;
|
||||
typedef typename Slist::size_type size_type;
|
||||
/// @endcond
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE bucket_traits_impl(bucket_ptr buckets, size_type len)
|
||||
: buckets_(buckets), buckets_len_(len)
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE bucket_traits_impl(const bucket_traits_impl &x)
|
||||
: buckets_(x.buckets_), buckets_len_(x.buckets_len_)
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE bucket_traits_impl(BOOST_RV_REF(bucket_traits_impl) x)
|
||||
: buckets_(x.buckets_), buckets_len_(x.buckets_len_)
|
||||
{ x.buckets_ = bucket_ptr(); x.buckets_len_ = 0; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE bucket_traits_impl& operator=(BOOST_RV_REF(bucket_traits_impl) x)
|
||||
{
|
||||
buckets_ = x.buckets_; buckets_len_ = x.buckets_len_;
|
||||
x.buckets_ = bucket_ptr(); x.buckets_len_ = 0; return *this;
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE bucket_traits_impl& operator=(BOOST_COPY_ASSIGN_REF(bucket_traits_impl) x)
|
||||
{
|
||||
buckets_ = x.buckets_; buckets_len_ = x.buckets_len_; return *this;
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE const bucket_ptr &bucket_begin() const
|
||||
{ return buckets_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE size_type bucket_count() const
|
||||
{ return buckets_len_; }
|
||||
|
||||
private:
|
||||
bucket_ptr buckets_;
|
||||
size_type buckets_len_;
|
||||
};
|
||||
|
||||
template <class NodeTraits>
|
||||
struct hash_reduced_slist_node_traits
|
||||
@@ -133,22 +100,7 @@ struct reduced_slist_node_traits
|
||||
>::type type;
|
||||
};
|
||||
|
||||
template<class NodeTraits>
|
||||
struct get_slist_impl
|
||||
{
|
||||
typedef trivial_value_traits<NodeTraits, normal_link> trivial_traits;
|
||||
|
||||
//Reducing symbol length
|
||||
struct type : make_slist
|
||||
< typename NodeTraits::node
|
||||
, boost::intrusive::value_traits<trivial_traits>
|
||||
, boost::intrusive::constant_time_size<false>
|
||||
, boost::intrusive::size_type<std::size_t>
|
||||
>::type
|
||||
{};
|
||||
};
|
||||
|
||||
template<class BucketValueTraits, bool IsConst>
|
||||
template<class BucketValueTraits, bool LinearBuckets, bool IsConst>
|
||||
class hashtable_iterator
|
||||
{
|
||||
typedef typename BucketValueTraits::value_traits value_traits;
|
||||
@@ -166,24 +118,25 @@ class hashtable_iterator
|
||||
private:
|
||||
typedef typename value_traits::node_traits node_traits;
|
||||
typedef typename node_traits::node_ptr node_ptr;
|
||||
typedef typename get_slist_impl
|
||||
< typename reduced_slist_node_traits
|
||||
<node_traits>::type >::type slist_impl;
|
||||
typedef typename slist_impl::iterator siterator;
|
||||
typedef typename slist_impl::const_iterator const_siterator;
|
||||
typedef bucket_impl<slist_impl> bucket_type;
|
||||
typedef typename BucketValueTraits::bucket_type bucket_type;
|
||||
typedef typename bucket_type::node_traits slist_node_traits;
|
||||
typedef typename slist_node_traits::node_ptr slist_node_ptr;
|
||||
typedef trivial_value_traits
|
||||
<slist_node_traits, normal_link> slist_value_traits;
|
||||
typedef slist_iterator<slist_value_traits, false> siterator;
|
||||
typedef slist_iterator<slist_value_traits, true> const_siterator;
|
||||
typedef circular_slist_algorithms<slist_node_traits> slist_node_algorithms;
|
||||
|
||||
typedef typename pointer_traits
|
||||
<pointer>::template rebind_pointer
|
||||
< const BucketValueTraits >::type const_bucketvaltraits_ptr;
|
||||
typedef typename slist_impl::size_type size_type;
|
||||
class nat;
|
||||
typedef typename
|
||||
detail::if_c< IsConst
|
||||
, hashtable_iterator<BucketValueTraits, false>
|
||||
, hashtable_iterator<BucketValueTraits, LinearBuckets, false>
|
||||
, nat>::type nonconst_iterator;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr downcast_bucket(typename bucket_type::node_ptr p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr downcast_bucket(typename bucket_type::node_traits::node_ptr p)
|
||||
{
|
||||
return pointer_traits<node_ptr>::
|
||||
pointer_to(static_cast<typename node_traits::node&>(*p));
|
||||
@@ -211,8 +164,8 @@ class hashtable_iterator
|
||||
BOOST_INTRUSIVE_FORCEINLINE const siterator &slist_it() const
|
||||
{ return slist_it_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator<BucketValueTraits, false> unconst() const
|
||||
{ return hashtable_iterator<BucketValueTraits, false>(this->slist_it(), this->get_bucket_value_traits()); }
|
||||
BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator<BucketValueTraits, LinearBuckets, false> unconst() const
|
||||
{ return hashtable_iterator<BucketValueTraits, LinearBuckets, false>(this->slist_it(), this->get_bucket_value_traits()); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator& operator++()
|
||||
{ this->increment(); return *this; }
|
||||
@@ -242,43 +195,42 @@ class hashtable_iterator
|
||||
(downcast_bucket(slist_it_.pointed_node()));
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE const const_bucketvaltraits_ptr &get_bucket_value_traits() const
|
||||
BOOST_INTRUSIVE_FORCEINLINE const_bucketvaltraits_ptr get_bucket_value_traits() const
|
||||
{ return traitsptr_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE const value_traits &priv_value_traits() const
|
||||
{ return traitsptr_->priv_value_traits(); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE const bucket_traits &priv_bucket_traits() const
|
||||
{ return traitsptr_->priv_bucket_traits(); }
|
||||
|
||||
private:
|
||||
|
||||
void increment()
|
||||
{
|
||||
const bucket_traits &rbuck_traits = this->priv_bucket_traits();
|
||||
bucket_type* const buckets = boost::movelib::to_raw_pointer(rbuck_traits.bucket_begin());
|
||||
const size_type buckets_len = rbuck_traits.bucket_count();
|
||||
bucket_type* const buckets = boost::movelib::to_raw_pointer(traitsptr_->priv_bucket_traits().bucket_begin());
|
||||
const std::size_t buckets_len = traitsptr_->priv_bucket_traits().bucket_count();
|
||||
|
||||
++slist_it_;
|
||||
const typename slist_impl::node_ptr n = slist_it_.pointed_node();
|
||||
const siterator first_bucket_bbegin = buckets->end();
|
||||
if(first_bucket_bbegin.pointed_node() <= n && n <= buckets[buckets_len-1].cend().pointed_node()){
|
||||
const slist_node_ptr n = slist_it_.pointed_node();
|
||||
const siterator first_bucket_bbegin(buckets->get_node_ptr());
|
||||
if(first_bucket_bbegin.pointed_node() <= n && n <= buckets[buckets_len-1].get_node_ptr()){
|
||||
//If one-past the node is inside the bucket then look for the next non-empty bucket
|
||||
//1. get the bucket_impl from the iterator
|
||||
const bucket_type &b = static_cast<const bucket_type&>
|
||||
(bucket_type::slist_type::container_from_end_iterator(slist_it_));
|
||||
const bucket_type &b = static_cast<const bucket_type&>(*n);
|
||||
|
||||
//2. Now just calculate the index b has in the bucket array
|
||||
size_type n_bucket = static_cast<size_type>(&b - buckets);
|
||||
std::size_t n_bucket = static_cast<std::size_t>(&b - buckets);
|
||||
|
||||
//3. Iterate until a non-empty bucket is found
|
||||
slist_node_ptr bucket_nodeptr = buckets->get_node_ptr();
|
||||
do{
|
||||
if (++n_bucket >= buckets_len){ //bucket overflow, return end() iterator
|
||||
slist_it_ = buckets->before_begin();
|
||||
slist_it_ = first_bucket_bbegin;
|
||||
return;
|
||||
}
|
||||
bucket_nodeptr = buckets[n_bucket].get_node_ptr();
|
||||
}
|
||||
while (buckets[n_bucket].empty());
|
||||
slist_it_ = buckets[n_bucket].begin();
|
||||
while (slist_node_algorithms::is_empty(bucket_nodeptr));
|
||||
slist_it_ = siterator(bucket_nodeptr);
|
||||
++slist_it_;
|
||||
}
|
||||
else{
|
||||
//++slist_it_ yield to a valid object
|
||||
@@ -289,6 +241,134 @@ class hashtable_iterator
|
||||
const_bucketvaltraits_ptr traitsptr_;
|
||||
};
|
||||
|
||||
template<class BucketValueTraits, bool IsConst>
|
||||
class hashtable_iterator<BucketValueTraits, true, IsConst>
|
||||
{
|
||||
typedef typename BucketValueTraits::value_traits value_traits;
|
||||
typedef typename BucketValueTraits::bucket_traits bucket_traits;
|
||||
|
||||
typedef iiterator< value_traits, IsConst
|
||||
, std::forward_iterator_tag> types_t;
|
||||
public:
|
||||
typedef typename types_t::iterator_type::difference_type difference_type;
|
||||
typedef typename types_t::iterator_type::value_type value_type;
|
||||
typedef typename types_t::iterator_type::pointer pointer;
|
||||
typedef typename types_t::iterator_type::reference reference;
|
||||
typedef typename types_t::iterator_type::iterator_category iterator_category;
|
||||
|
||||
private:
|
||||
typedef typename value_traits::node_traits node_traits;
|
||||
typedef typename node_traits::node_ptr node_ptr;
|
||||
typedef typename BucketValueTraits::bucket_type bucket_type;
|
||||
typedef typename BucketValueTraits::bucket_ptr bucket_ptr;
|
||||
typedef typename bucket_type::node_traits slist_node_traits;
|
||||
typedef linear_slist_algorithms<slist_node_traits> slist_node_algorithms;
|
||||
typedef typename slist_node_traits::node_ptr slist_node_ptr;
|
||||
typedef trivial_value_traits
|
||||
<slist_node_traits, normal_link> slist_value_traits;
|
||||
typedef slist_iterator<slist_value_traits, false> siterator;
|
||||
typedef slist_iterator<slist_value_traits, true> const_siterator;
|
||||
|
||||
static const bool stateful_value_traits =
|
||||
detail::is_stateful_value_traits<value_traits>::value;
|
||||
|
||||
typedef typename pointer_traits
|
||||
<pointer>::template rebind_pointer
|
||||
< const value_traits >::type const_value_traits_ptr;
|
||||
class nat;
|
||||
typedef typename
|
||||
detail::if_c< IsConst
|
||||
, hashtable_iterator<BucketValueTraits, true, false>
|
||||
, nat>::type nonconst_iterator;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr downcast_bucket(slist_node_ptr p)
|
||||
{
|
||||
return pointer_traits<node_ptr>::
|
||||
pointer_to(static_cast<typename node_traits::node&>(*p));
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator ()
|
||||
: slist_it_() //Value initialization to achieve "null iterators" (N3644)
|
||||
, members_()
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit hashtable_iterator(siterator ptr, bucket_ptr bp, const_value_traits_ptr traits_ptr)
|
||||
: slist_it_ (ptr)
|
||||
, members_ (bp, traits_ptr)
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator(const hashtable_iterator &other)
|
||||
: slist_it_(other.slist_it()), members_(other.get_bucket_ptr(), other.get_value_traits())
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator(const nonconst_iterator &other)
|
||||
: slist_it_(other.slist_it()), members_(other.get_bucket_ptr(), other.get_value_traits())
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE const siterator &slist_it() const
|
||||
{ return slist_it_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator<BucketValueTraits, true, false> unconst() const
|
||||
{ return hashtable_iterator<BucketValueTraits, true, false>(this->slist_it(), members_.nodeptr_, members_.get_ptr()); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator& operator++()
|
||||
{ this->increment(); return *this; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator &operator=(const hashtable_iterator &other)
|
||||
{ slist_it_ = other.slist_it(); members_ = other.members_; return *this; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator operator++(int)
|
||||
{
|
||||
hashtable_iterator result (*this);
|
||||
this->increment();
|
||||
return result;
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE friend bool operator== (const hashtable_iterator& i, const hashtable_iterator& i2)
|
||||
{ return i.slist_it_ == i2.slist_it_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE friend bool operator!= (const hashtable_iterator& i, const hashtable_iterator& i2)
|
||||
{ return i.slist_it_ != i2.slist_it_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE reference operator*() const
|
||||
{ return *this->operator ->(); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE pointer operator->() const
|
||||
{ return this->operator_arrow(detail::bool_<stateful_value_traits>()); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE const_value_traits_ptr get_value_traits() const
|
||||
{ return members_.get_ptr(); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE bucket_ptr get_bucket_ptr() const
|
||||
{ return members_.nodeptr_; }
|
||||
|
||||
private:
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE pointer operator_arrow(detail::false_) const
|
||||
{ return value_traits::to_value_ptr(downcast_bucket(slist_it_.pointed_node())); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE pointer operator_arrow(detail::true_) const
|
||||
{ return this->get_value_traits()->to_value_ptr(downcast_bucket(slist_it_.pointed_node())); }
|
||||
|
||||
void increment()
|
||||
{
|
||||
++slist_it_;
|
||||
if (slist_it_ == siterator()){
|
||||
slist_node_ptr bucket_nodeptr;
|
||||
do {
|
||||
++members_.nodeptr_;
|
||||
bucket_nodeptr = members_.nodeptr_->get_node_ptr();
|
||||
}while(slist_node_algorithms::is_empty(bucket_nodeptr));
|
||||
slist_it_ = siterator(slist_node_traits::get_next(bucket_nodeptr));
|
||||
}
|
||||
}
|
||||
|
||||
siterator slist_it_;
|
||||
iiterator_members<bucket_ptr, const_value_traits_ptr, stateful_value_traits> members_;
|
||||
};
|
||||
|
||||
} //namespace intrusive {
|
||||
} //namespace boost {
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <boost/intrusive/detail/mpl.hpp>
|
||||
#include <boost/move/detail/to_raw_pointer.hpp>
|
||||
#include <boost/intrusive/detail/node_holder.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
@@ -55,7 +56,7 @@ struct bhtraits_base
|
||||
typedef node& node_reference;
|
||||
typedef const node & const_node_reference;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer to_value_ptr(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer to_value_ptr(node_ptr n)
|
||||
{
|
||||
pointer p = pointer_traits<pointer>::pointer_to
|
||||
(static_cast<reference>(static_cast<node_holder_reference>(*n)));
|
||||
@@ -63,7 +64,7 @@ struct bhtraits_base
|
||||
return p;
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const_node_ptr n)
|
||||
{
|
||||
const_pointer p = pointer_traits<const_pointer>::pointer_to
|
||||
(static_cast<const_reference>(static_cast<const_node_holder_reference>(*n)));
|
||||
@@ -132,14 +133,14 @@ struct mhtraits
|
||||
(static_cast<const_node_reference>(static_cast<const_hook_reference>(value.*P)));
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer to_value_ptr(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer to_value_ptr(node_ptr n)
|
||||
{
|
||||
return pointer_traits<pointer>::pointer_to
|
||||
(*detail::parent_from_member<T, Hook>
|
||||
(static_cast<Hook*>(boost::movelib::to_raw_pointer(n)), P));
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const_node_ptr n)
|
||||
{
|
||||
return pointer_traits<const_pointer>::pointer_to
|
||||
(*detail::parent_from_member<T, Hook>
|
||||
@@ -174,17 +175,17 @@ struct fhtraits
|
||||
static const_node_ptr to_node_ptr(const_reference value)
|
||||
{ return static_cast<const node*>(boost::movelib::to_raw_pointer(Functor::to_hook_ptr(value))); }
|
||||
|
||||
static pointer to_value_ptr(const node_ptr & n)
|
||||
static pointer to_value_ptr(node_ptr n)
|
||||
{ return Functor::to_value_ptr(to_hook_ptr(n)); }
|
||||
|
||||
static const_pointer to_value_ptr(const const_node_ptr & n)
|
||||
static const_pointer to_value_ptr(const_node_ptr n)
|
||||
{ return Functor::to_value_ptr(to_hook_ptr(n)); }
|
||||
|
||||
private:
|
||||
static hook_ptr to_hook_ptr(const node_ptr & n)
|
||||
static hook_ptr to_hook_ptr(node_ptr n)
|
||||
{ return hook_ptr(&*static_cast<hook_type*>(&*n)); }
|
||||
|
||||
static const_hook_ptr to_hook_ptr(const const_node_ptr & n)
|
||||
static const_hook_ptr to_hook_ptr(const_node_ptr n)
|
||||
{ return const_hook_ptr(&*static_cast<const hook_type*>(&*n)); }
|
||||
};
|
||||
|
||||
|
||||
@@ -49,6 +49,11 @@ namespace boost {
|
||||
namespace intrusive {
|
||||
|
||||
using boost::movelib::iterator_traits;
|
||||
using boost::movelib::iter_difference;
|
||||
using boost::movelib::iter_value;
|
||||
using boost::movelib::iter_category;
|
||||
using boost::movelib::iter_size;
|
||||
|
||||
|
||||
////////////////////
|
||||
// iterator
|
||||
@@ -63,26 +68,59 @@ struct iterator
|
||||
typedef Reference reference;
|
||||
};
|
||||
|
||||
////////////////////////////////////////
|
||||
// iterator_[dis|en]able_if_boost_iterator
|
||||
////////////////////////////////////////
|
||||
template<class I>
|
||||
struct is_boost_iterator
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Conversion from boost::iterator traversals to std tags
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<class Tag>
|
||||
struct get_std_category_from_tag
|
||||
{
|
||||
static const bool value = false;
|
||||
typedef Tag type;
|
||||
};
|
||||
|
||||
template<class Category, class Traversal>
|
||||
struct is_boost_iterator< boost::iterators::detail::iterator_category_with_traversal<Category, Traversal> >
|
||||
template <class Category>
|
||||
struct get_std_category_from_tag
|
||||
<boost::iterators::detail::iterator_category_with_traversal
|
||||
<Category, boost::iterators::incrementable_traversal_tag> >
|
||||
{
|
||||
static const bool value = true;
|
||||
typedef std::input_iterator_tag type;
|
||||
};
|
||||
|
||||
template<class I, class R = void>
|
||||
struct iterator_enable_if_boost_iterator
|
||||
: ::boost::move_detail::enable_if_c
|
||||
< is_boost_iterator<typename boost::intrusive::iterator_traits<I>::iterator_category >::value
|
||||
, R>
|
||||
template <class Category>
|
||||
struct get_std_category_from_tag
|
||||
<boost::iterators::detail::iterator_category_with_traversal
|
||||
<Category, boost::iterators::single_pass_traversal_tag> >
|
||||
{
|
||||
typedef std::input_iterator_tag type;
|
||||
};
|
||||
|
||||
template <class Category>
|
||||
struct get_std_category_from_tag
|
||||
<boost::iterators::detail::iterator_category_with_traversal
|
||||
<Category, boost::iterators::forward_traversal_tag> >
|
||||
{
|
||||
typedef std::input_iterator_tag type;
|
||||
};
|
||||
|
||||
template <class Category>
|
||||
struct get_std_category_from_tag
|
||||
<boost::iterators::detail::iterator_category_with_traversal
|
||||
<Category, boost::iterators::bidirectional_traversal_tag> >
|
||||
{
|
||||
typedef std::bidirectional_iterator_tag type;
|
||||
};
|
||||
|
||||
template <class Category>
|
||||
struct get_std_category_from_tag
|
||||
<boost::iterators::detail::iterator_category_with_traversal
|
||||
<Category, boost::iterators::random_access_traversal_tag> >
|
||||
{
|
||||
typedef std::random_access_iterator_tag type;
|
||||
};
|
||||
|
||||
template<class It>
|
||||
struct get_std_category_from_it
|
||||
: get_std_category_from_tag< typename boost::intrusive::iter_category<It>::type >
|
||||
{};
|
||||
|
||||
////////////////////////////////////////
|
||||
@@ -92,7 +130,7 @@ template<class I, class Tag, class R = void>
|
||||
struct iterator_enable_if_tag
|
||||
: ::boost::move_detail::enable_if_c
|
||||
< ::boost::move_detail::is_same
|
||||
< typename boost::intrusive::iterator_traits<I>::iterator_category
|
||||
< typename get_std_category_from_it<I>::type
|
||||
, Tag
|
||||
>::value
|
||||
, R>
|
||||
@@ -102,7 +140,7 @@ template<class I, class Tag, class R = void>
|
||||
struct iterator_disable_if_tag
|
||||
: ::boost::move_detail::enable_if_c
|
||||
< !::boost::move_detail::is_same
|
||||
< typename boost::intrusive::iterator_traits<I>::iterator_category
|
||||
< typename get_std_category_from_it<I>::type
|
||||
, Tag
|
||||
>::value
|
||||
, R>
|
||||
@@ -115,11 +153,11 @@ template<class I, class Tag, class Tag2, class R = void>
|
||||
struct iterator_enable_if_convertible_tag
|
||||
: ::boost::move_detail::enable_if_c
|
||||
< ::boost::move_detail::is_same_or_convertible
|
||||
< typename boost::intrusive::iterator_traits<I>::iterator_category
|
||||
< typename get_std_category_from_it<I>::type
|
||||
, Tag
|
||||
>::value &&
|
||||
!::boost::move_detail::is_same_or_convertible
|
||||
< typename boost::intrusive::iterator_traits<I>::iterator_category
|
||||
< typename get_std_category_from_it<I>::type
|
||||
, Tag2
|
||||
>::value
|
||||
, R>
|
||||
@@ -130,37 +168,37 @@ struct iterator_enable_if_convertible_tag
|
||||
////////////////////////////////////////
|
||||
template<class I, class Tag>
|
||||
struct iterator_enable_if_tag_difference_type
|
||||
: iterator_enable_if_tag<I, Tag, typename boost::intrusive::iterator_traits<I>::difference_type>
|
||||
: iterator_enable_if_tag<I, Tag, typename boost::intrusive::iter_difference<I>::type>
|
||||
{};
|
||||
|
||||
template<class I, class Tag>
|
||||
struct iterator_disable_if_tag_difference_type
|
||||
: iterator_disable_if_tag<I, Tag, typename boost::intrusive::iterator_traits<I>::difference_type>
|
||||
: iterator_disable_if_tag<I, Tag, typename boost::intrusive::iter_difference<I>::type>
|
||||
{};
|
||||
|
||||
////////////////////
|
||||
// advance
|
||||
////////////////////
|
||||
|
||||
template<class InputIt, class Distance>
|
||||
template<class InputIt>
|
||||
BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_tag<InputIt, std::input_iterator_tag>::type
|
||||
iterator_advance(InputIt& it, Distance n)
|
||||
iterator_advance(InputIt& it, typename iter_difference<InputIt>::type n)
|
||||
{
|
||||
while(n--)
|
||||
++it;
|
||||
}
|
||||
|
||||
template<class InputIt, class Distance>
|
||||
template<class InputIt>
|
||||
typename iterator_enable_if_tag<InputIt, std::forward_iterator_tag>::type
|
||||
iterator_advance(InputIt& it, Distance n)
|
||||
iterator_advance(InputIt& it, typename iter_difference<InputIt>::type n)
|
||||
{
|
||||
while(n--)
|
||||
++it;
|
||||
}
|
||||
|
||||
template<class InputIt, class Distance>
|
||||
template<class InputIt>
|
||||
BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_tag<InputIt, std::bidirectional_iterator_tag>::type
|
||||
iterator_advance(InputIt& it, Distance n)
|
||||
iterator_advance(InputIt& it, typename iter_difference<InputIt>::type n)
|
||||
{
|
||||
for (; 0 < n; --n)
|
||||
++it;
|
||||
@@ -176,62 +214,37 @@ BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_tag<InputIt, std::random
|
||||
}
|
||||
|
||||
template<class InputIt, class Distance>
|
||||
BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_convertible_tag
|
||||
<InputIt, const boost::iterators::incrementable_traversal_tag&, const boost::iterators::single_pass_traversal_tag&>::type
|
||||
iterator_advance(InputIt& it, Distance n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_tag<InputIt, std::random_access_iterator_tag, InputIt>::type
|
||||
make_iterator_advance(InputIt it, Distance n)
|
||||
{
|
||||
while(n--)
|
||||
++it;
|
||||
(iterator_advance)(it, n);
|
||||
return it;
|
||||
}
|
||||
|
||||
template<class InputIt, class Distance>
|
||||
BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_convertible_tag
|
||||
<InputIt, const boost::iterators::single_pass_traversal_tag &, const boost::iterators::forward_traversal_tag&>::type
|
||||
iterator_advance(InputIt& it, Distance n)
|
||||
template<class It>
|
||||
BOOST_INTRUSIVE_FORCEINLINE
|
||||
void iterator_uadvance(It& it, typename iter_size<It>::type n)
|
||||
{
|
||||
while(n--)
|
||||
++it;
|
||||
(iterator_advance)(it, (typename iterator_traits<It>::difference_type)n);
|
||||
}
|
||||
|
||||
template<class InputIt, class Distance>
|
||||
BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_convertible_tag
|
||||
<InputIt, const boost::iterators::forward_traversal_tag&, const boost::iterators::bidirectional_traversal_tag&>::type
|
||||
iterator_advance(InputIt& it, Distance n)
|
||||
template<class It>
|
||||
BOOST_INTRUSIVE_FORCEINLINE
|
||||
It make_iterator_uadvance(It it, typename iter_size<It>::type n)
|
||||
{
|
||||
while(n--)
|
||||
++it;
|
||||
(iterator_uadvance)(it, n);
|
||||
return it;
|
||||
}
|
||||
|
||||
template<class InputIt, class Distance>
|
||||
BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_convertible_tag
|
||||
<InputIt, const boost::iterators::bidirectional_traversal_tag&, const boost::iterators::random_access_traversal_tag&>::type
|
||||
iterator_advance(InputIt& it, Distance n)
|
||||
{
|
||||
for (; 0 < n; --n)
|
||||
++it;
|
||||
for (; n < 0; ++n)
|
||||
--it;
|
||||
}
|
||||
|
||||
class fake{};
|
||||
|
||||
template<class InputIt, class Distance>
|
||||
BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_convertible_tag
|
||||
<InputIt, const boost::iterators::random_access_traversal_tag&, const fake&>::type
|
||||
iterator_advance(InputIt& it, Distance n)
|
||||
{
|
||||
it += n;
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// distance
|
||||
////////////////////
|
||||
////////////////////////////////////////
|
||||
// iterator_distance
|
||||
////////////////////////////////////////
|
||||
template<class InputIt> inline
|
||||
typename iterator_disable_if_tag_difference_type
|
||||
<InputIt, std::random_access_iterator_tag>::type
|
||||
iterator_distance(InputIt first, InputIt last)
|
||||
{
|
||||
typename iterator_traits<InputIt>::difference_type off = 0;
|
||||
typename iter_difference<InputIt>::type off = 0;
|
||||
while(first != last){
|
||||
++off;
|
||||
++first;
|
||||
@@ -244,10 +257,43 @@ BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_tag_difference_type
|
||||
<InputIt, std::random_access_iterator_tag>::type
|
||||
iterator_distance(InputIt first, InputIt last)
|
||||
{
|
||||
typename iterator_traits<InputIt>::difference_type off = last - first;
|
||||
typename iter_difference<InputIt>::type off = last - first;
|
||||
return off;
|
||||
}
|
||||
|
||||
////////////////////////////////////////
|
||||
// iterator_udistance
|
||||
////////////////////////////////////////
|
||||
|
||||
template<class It>
|
||||
BOOST_INTRUSIVE_FORCEINLINE typename iter_size<It>::type
|
||||
iterator_udistance(It first, It last)
|
||||
{
|
||||
return (typename iter_size<It>::type)(iterator_distance)(first, last);
|
||||
}
|
||||
|
||||
////////////////////////////////////////
|
||||
// iterator_next
|
||||
////////////////////////////////////////
|
||||
|
||||
template<class InputIt>
|
||||
BOOST_INTRUSIVE_FORCEINLINE InputIt iterator_next(InputIt it, typename iter_difference<InputIt>::type n)
|
||||
{
|
||||
(iterator_advance)(it, n);
|
||||
return it;
|
||||
}
|
||||
|
||||
template<class InputIt>
|
||||
BOOST_INTRUSIVE_FORCEINLINE InputIt iterator_unext(InputIt it, typename iterator_traits<InputIt>::size_type n)
|
||||
{
|
||||
(iterator_uadvance)(it, n);
|
||||
return it;
|
||||
}
|
||||
|
||||
////////////////////////////////////////
|
||||
// iterator_arrow_result
|
||||
////////////////////////////////////////
|
||||
|
||||
template<class I>
|
||||
BOOST_INTRUSIVE_FORCEINLINE typename iterator_traits<I>::pointer iterator_arrow_result(const I &i)
|
||||
{ return i.operator->(); }
|
||||
|
||||
@@ -63,7 +63,7 @@ class list_iterator
|
||||
BOOST_INTRUSIVE_FORCEINLINE list_iterator()
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit list_iterator(const node_ptr & nodeptr, const const_value_traits_ptr &traits_ptr)
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit list_iterator(node_ptr nodeptr, const_value_traits_ptr traits_ptr)
|
||||
: members_(nodeptr, traits_ptr)
|
||||
{}
|
||||
|
||||
@@ -81,8 +81,8 @@ class list_iterator
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr pointed_node() const
|
||||
{ return members_.nodeptr_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE list_iterator &operator=(const node_ptr &node)
|
||||
{ members_.nodeptr_ = node; return *this; }
|
||||
BOOST_INTRUSIVE_FORCEINLINE list_iterator &operator=(node_ptr nodeptr)
|
||||
{ members_.nodeptr_ = nodeptr; return *this; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE const_value_traits_ptr get_value_traits() const
|
||||
{ return members_.get_ptr(); }
|
||||
|
||||
@@ -47,19 +47,19 @@ struct list_node_traits
|
||||
typedef typename node::node_ptr node_ptr;
|
||||
typedef typename pointer_rebind<VoidPointer, const node>::type const_node_ptr;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous(const_node_ptr n)
|
||||
{ return n->prev_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous(node_ptr n)
|
||||
{ return n->prev_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_previous(node_ptr n, node_ptr prev)
|
||||
{ n->prev_ = prev; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const_node_ptr n)
|
||||
{ return n->next_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(node_ptr n)
|
||||
{ return n->next_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_next(node_ptr n, node_ptr next)
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <cstddef>
|
||||
#include <climits>
|
||||
#include <boost/intrusive/detail/mpl.hpp>
|
||||
#include <cstring>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
@@ -75,8 +76,8 @@ namespace detail {
|
||||
inline std::size_t floor_log2 (std::size_t x)
|
||||
{
|
||||
unsigned long log2;
|
||||
BOOST_INTRUSIVE_BSR_INTRINSIC( &log2, (unsigned long)x );
|
||||
return log2;
|
||||
BOOST_INTRUSIVE_BSR_INTRINSIC( &log2, x );
|
||||
return static_cast<std::size_t>(log2);
|
||||
}
|
||||
|
||||
#undef BOOST_INTRUSIVE_BSR_INTRINSIC
|
||||
@@ -92,7 +93,7 @@ namespace detail {
|
||||
struct builtin_clz_dispatch< ::boost::ulong_long_type >
|
||||
{
|
||||
static ::boost::ulong_long_type call(::boost::ulong_long_type n)
|
||||
{ return __builtin_clzll(n); }
|
||||
{ return (::boost::ulong_long_type)__builtin_clzll(n); }
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -100,14 +101,14 @@ namespace detail {
|
||||
struct builtin_clz_dispatch<unsigned long>
|
||||
{
|
||||
static unsigned long call(unsigned long n)
|
||||
{ return __builtin_clzl(n); }
|
||||
{ return (unsigned long)__builtin_clzl(n); }
|
||||
};
|
||||
|
||||
template<>
|
||||
struct builtin_clz_dispatch<unsigned int>
|
||||
{
|
||||
static unsigned int call(unsigned int n)
|
||||
{ return __builtin_clz(n); }
|
||||
{ return (unsigned int)__builtin_clz(n); }
|
||||
};
|
||||
|
||||
inline std::size_t floor_log2(std::size_t n)
|
||||
@@ -149,53 +150,6 @@ namespace detail {
|
||||
return log2;
|
||||
}
|
||||
|
||||
////////////////////////////
|
||||
// DeBruijn method
|
||||
////////////////////////////
|
||||
|
||||
//Taken from:
|
||||
//http://stackoverflow.com/questions/11376288/fast-computing-of-log2-for-64-bit-integers
|
||||
//Thanks to Desmond Hume
|
||||
|
||||
inline std::size_t floor_log2 (std::size_t v, integral_constant<std::size_t, 32>)
|
||||
{
|
||||
static const int MultiplyDeBruijnBitPosition[32] =
|
||||
{
|
||||
0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30,
|
||||
8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31
|
||||
};
|
||||
|
||||
v |= v >> 1;
|
||||
v |= v >> 2;
|
||||
v |= v >> 4;
|
||||
v |= v >> 8;
|
||||
v |= v >> 16;
|
||||
|
||||
return MultiplyDeBruijnBitPosition[(std::size_t)(v * 0x07C4ACDDU) >> 27];
|
||||
}
|
||||
|
||||
inline std::size_t floor_log2 (std::size_t v, integral_constant<std::size_t, 64>)
|
||||
{
|
||||
static const std::size_t MultiplyDeBruijnBitPosition[64] = {
|
||||
63, 0, 58, 1, 59, 47, 53, 2,
|
||||
60, 39, 48, 27, 54, 33, 42, 3,
|
||||
61, 51, 37, 40, 49, 18, 28, 20,
|
||||
55, 30, 34, 11, 43, 14, 22, 4,
|
||||
62, 57, 46, 52, 38, 26, 32, 41,
|
||||
50, 36, 17, 19, 29, 10, 13, 21,
|
||||
56, 45, 25, 31, 35, 16, 9, 12,
|
||||
44, 24, 15, 8, 23, 7, 6, 5};
|
||||
|
||||
v |= v >> 1;
|
||||
v |= v >> 2;
|
||||
v |= v >> 4;
|
||||
v |= v >> 8;
|
||||
v |= v >> 16;
|
||||
v |= v >> 32;
|
||||
return MultiplyDeBruijnBitPosition[((std::size_t)((v - (v >> 1))*0x07EDD5E59A4E28C2ULL)) >> 58];
|
||||
}
|
||||
|
||||
|
||||
inline std::size_t floor_log2 (std::size_t x)
|
||||
{
|
||||
const std::size_t Bits = sizeof(std::size_t)*CHAR_BIT;
|
||||
@@ -208,19 +162,12 @@ namespace detail {
|
||||
//http://www.flipcode.com/archives/Fast_log_Function.shtml
|
||||
inline float fast_log2 (float val)
|
||||
{
|
||||
union caster_t
|
||||
{
|
||||
unsigned x;
|
||||
float val;
|
||||
} caster;
|
||||
|
||||
caster.val = val;
|
||||
unsigned x = caster.x;
|
||||
unsigned x;
|
||||
std::memcpy(&x, &val, sizeof(float));
|
||||
const int log_2 = int((x >> 23) & 255) - 128;
|
||||
x &= ~(unsigned(255u) << 23u);
|
||||
x += unsigned(127) << 23u;
|
||||
caster.x = x;
|
||||
val = caster.val;
|
||||
std::memcpy(&val, &x, sizeof(float));
|
||||
//1+log2(m), m ranging from 1 to 2
|
||||
//3rd degree polynomial keeping first derivate continuity.
|
||||
//For less precision the line can be commented out
|
||||
|
||||
@@ -155,7 +155,7 @@ template <class T>\
|
||||
struct TRAITS_PREFIX##_bool\
|
||||
{\
|
||||
template<bool Add>\
|
||||
struct two_or_three {yes_type _[2 + Add];};\
|
||||
struct two_or_three {yes_type _[2u + (unsigned)Add];};\
|
||||
template <class U> static yes_type test(...);\
|
||||
template <class U> static two_or_three<U::TYPEDEF_TO_FIND> test (int);\
|
||||
static const std::size_t value = sizeof(test<T>(0));\
|
||||
|
||||
@@ -59,7 +59,7 @@ struct node_cloner
|
||||
{}
|
||||
|
||||
// tree-based containers use this method, which is proxy-reference friendly
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr operator()(const node_ptr & p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr operator()(node_ptr p)
|
||||
{
|
||||
reference_type v = *traits_->to_value_ptr(p);
|
||||
node_ptr n = traits_->to_node_ptr(*base_t::get()(v));
|
||||
@@ -85,13 +85,13 @@ struct node_disposer
|
||||
static const bool safemode_or_autounlink =
|
||||
is_safe_autounlink<value_traits::link_mode>::value;
|
||||
|
||||
node_disposer(F f, const ValueTraits *cont)
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_disposer(F f, const ValueTraits *cont)
|
||||
: base_t(f), traits_(cont)
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE void operator()(const node_ptr & p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void operator()(node_ptr p)
|
||||
{
|
||||
if(safemode_or_autounlink)
|
||||
BOOST_IF_CONSTEXPR(safemode_or_autounlink)
|
||||
node_algorithms::init(p);
|
||||
base_t::get()(traits_->to_value_ptr(p));
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ struct node_to_value
|
||||
typedef typename pointer_traits<npointer>::
|
||||
template rebind_pointer<const ValueTraits>::type const_value_traits_ptr;
|
||||
|
||||
node_to_value(const const_value_traits_ptr &ptr)
|
||||
node_to_value(const_value_traits_ptr ptr)
|
||||
: Base(ptr)
|
||||
{}
|
||||
|
||||
|
||||
@@ -74,40 +74,40 @@ struct default_rbtree_node_traits_impl
|
||||
|
||||
typedef typename node::color color;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const_node_ptr n)
|
||||
{ return n->parent_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(node_ptr n)
|
||||
{ return n->parent_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(node_ptr n, node_ptr p)
|
||||
{ n->parent_ = p; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const_node_ptr n)
|
||||
{ return n->left_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(node_ptr n)
|
||||
{ return n->left_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(node_ptr n, node_ptr l)
|
||||
{ n->left_ = l; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const_node_ptr n)
|
||||
{ return n->right_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(node_ptr n)
|
||||
{ return n->right_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(node_ptr n, node_ptr r)
|
||||
{ n->right_ = r; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static color get_color(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static color get_color(const_node_ptr n)
|
||||
{ return n->color_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static color get_color(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static color get_color(node_ptr n)
|
||||
{ return n->color_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_color(const node_ptr & n, color c)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_color(node_ptr n, color c)
|
||||
{ n->color_ = c; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static color black()
|
||||
@@ -130,40 +130,40 @@ struct compact_rbtree_node_traits_impl
|
||||
|
||||
typedef typename node::color color;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const_node_ptr n)
|
||||
{ return ptr_bit::get_pointer(n->parent_); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(node_ptr n)
|
||||
{ return ptr_bit::get_pointer(n->parent_); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(node_ptr n, node_ptr p)
|
||||
{ ptr_bit::set_pointer(n->parent_, p); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const_node_ptr n)
|
||||
{ return n->left_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(node_ptr n)
|
||||
{ return n->left_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(node_ptr n, node_ptr l)
|
||||
{ n->left_ = l; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const_node_ptr n)
|
||||
{ return n->right_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(node_ptr n)
|
||||
{ return n->right_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(node_ptr n, node_ptr r)
|
||||
{ n->right_ = r; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static color get_color(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static color get_color(const_node_ptr n)
|
||||
{ return (color)ptr_bit::get_bits(n->parent_); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static color get_color(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static color get_color(node_ptr n)
|
||||
{ return (color)ptr_bit::get_bits(n->parent_); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_color(const node_ptr & n, color c)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_color(node_ptr n, color c)
|
||||
{ ptr_bit::set_bits(n->parent_, c != 0); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static color black()
|
||||
|
||||
@@ -13,153 +13,16 @@
|
||||
#ifndef BOOST_INTRUSIVE_DETAIL_REVERSE_ITERATOR_HPP
|
||||
#define BOOST_INTRUSIVE_DETAIL_REVERSE_ITERATOR_HPP
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
# include <boost/config.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/intrusive/detail/config_begin.hpp>
|
||||
#include <boost/intrusive/detail/iterator.hpp>
|
||||
#include <boost/intrusive/detail/mpl.hpp>
|
||||
#include <boost/move/detail/reverse_iterator.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
|
||||
template<class It>
|
||||
class reverse_iterator
|
||||
{
|
||||
public:
|
||||
typedef typename boost::intrusive::iterator_traits<It>::pointer pointer;
|
||||
typedef typename boost::intrusive::iterator_traits<It>::reference reference;
|
||||
typedef typename boost::intrusive::iterator_traits<It>::difference_type difference_type;
|
||||
typedef typename boost::intrusive::iterator_traits<It>::iterator_category iterator_category;
|
||||
typedef typename boost::intrusive::iterator_traits<It>::value_type value_type;
|
||||
|
||||
|
||||
typedef It iterator_type;
|
||||
|
||||
reverse_iterator()
|
||||
: m_current() //Value initialization to achieve "null iterators" (N3644)
|
||||
{}
|
||||
|
||||
explicit reverse_iterator(It r)
|
||||
: m_current(r)
|
||||
{}
|
||||
|
||||
reverse_iterator(const reverse_iterator& r)
|
||||
: m_current(r.base())
|
||||
{}
|
||||
|
||||
template<class OtherIt>
|
||||
reverse_iterator( const reverse_iterator<OtherIt>& r
|
||||
, typename boost::intrusive::detail::enable_if_convertible<OtherIt, It>::type* =0
|
||||
)
|
||||
: m_current(r.base())
|
||||
{}
|
||||
|
||||
reverse_iterator & operator=( const reverse_iterator& r)
|
||||
{ m_current = r.base(); return *this; }
|
||||
|
||||
template<class OtherIt>
|
||||
typename boost::intrusive::detail::enable_if_convertible<OtherIt, It, reverse_iterator &>::type
|
||||
operator=( const reverse_iterator<OtherIt>& r)
|
||||
{ m_current = r.base(); return *this; }
|
||||
|
||||
It base() const
|
||||
{ return m_current; }
|
||||
|
||||
reference operator*() const
|
||||
{
|
||||
It temp(m_current);
|
||||
--temp;
|
||||
reference r = *temp;
|
||||
return r;
|
||||
}
|
||||
|
||||
pointer operator->() const
|
||||
{
|
||||
It temp(m_current);
|
||||
--temp;
|
||||
return iterator_arrow_result(temp);
|
||||
}
|
||||
|
||||
reference operator[](difference_type off) const
|
||||
{
|
||||
return this->m_current[-off - 1];
|
||||
}
|
||||
|
||||
reverse_iterator& operator++()
|
||||
{
|
||||
--m_current;
|
||||
return *this;
|
||||
}
|
||||
|
||||
reverse_iterator operator++(int)
|
||||
{
|
||||
reverse_iterator temp((*this));
|
||||
--m_current;
|
||||
return temp;
|
||||
}
|
||||
|
||||
reverse_iterator& operator--()
|
||||
{
|
||||
++m_current;
|
||||
return *this;
|
||||
}
|
||||
|
||||
reverse_iterator operator--(int)
|
||||
{
|
||||
reverse_iterator temp((*this));
|
||||
++m_current;
|
||||
return temp;
|
||||
}
|
||||
|
||||
friend bool operator==(const reverse_iterator& l, const reverse_iterator& r)
|
||||
{ return l.m_current == r.m_current; }
|
||||
|
||||
friend bool operator!=(const reverse_iterator& l, const reverse_iterator& r)
|
||||
{ return l.m_current != r.m_current; }
|
||||
|
||||
friend bool operator<(const reverse_iterator& l, const reverse_iterator& r)
|
||||
{ return l.m_current > r.m_current; }
|
||||
|
||||
friend bool operator<=(const reverse_iterator& l, const reverse_iterator& r)
|
||||
{ return l.m_current >= r.m_current; }
|
||||
|
||||
friend bool operator>(const reverse_iterator& l, const reverse_iterator& r)
|
||||
{ return l.m_current < r.m_current; }
|
||||
|
||||
friend bool operator>=(const reverse_iterator& l, const reverse_iterator& r)
|
||||
{ return l.m_current <= r.m_current; }
|
||||
|
||||
reverse_iterator& operator+=(difference_type off)
|
||||
{ m_current -= off; return *this; }
|
||||
|
||||
reverse_iterator& operator-=(difference_type off)
|
||||
{ m_current += off; return *this; }
|
||||
|
||||
friend reverse_iterator operator+(reverse_iterator l, difference_type off)
|
||||
{ return (l += off); }
|
||||
|
||||
friend reverse_iterator operator+(difference_type off, reverse_iterator r)
|
||||
{ return (r += off); }
|
||||
|
||||
friend reverse_iterator operator-(reverse_iterator l, difference_type off)
|
||||
{ return (l-= off); }
|
||||
|
||||
friend difference_type operator-(const reverse_iterator& l, const reverse_iterator& r)
|
||||
{ return r.m_current - l.m_current; }
|
||||
|
||||
private:
|
||||
It m_current; // the wrapped iterator
|
||||
};
|
||||
using boost::movelib::reverse_iterator;
|
||||
using boost::movelib::make_reverse_iterator;
|
||||
|
||||
} //namespace intrusive {
|
||||
} //namespace boost {
|
||||
|
||||
#include <boost/intrusive/detail/config_end.hpp>
|
||||
|
||||
#endif //BOOST_INTRUSIVE_DETAIL_REVERSE_ITERATOR_HPP
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#ifndef BOOST_INTRUSIVE_DETAIL_SIMPLE_DISPOSERS_HPP
|
||||
#define BOOST_INTRUSIVE_DETAIL_SIMPLE_DISPOSERS_HPP
|
||||
|
||||
#include <boost/intrusive/detail/workaround.hpp>
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
# include <boost/config.hpp>
|
||||
#endif
|
||||
@@ -39,7 +41,7 @@ class init_disposer
|
||||
typedef typename NodeAlgorithms::node_ptr node_ptr;
|
||||
|
||||
public:
|
||||
BOOST_INTRUSIVE_FORCEINLINE void operator()(const node_ptr & p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void operator()(node_ptr p)
|
||||
{ NodeAlgorithms::init(p); }
|
||||
};
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <boost/intrusive/detail/std_fwd.hpp>
|
||||
#include <boost/intrusive/detail/iiterator.hpp>
|
||||
#include <boost/intrusive/detail/mpl.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
@@ -65,10 +66,14 @@ class slist_iterator
|
||||
BOOST_INTRUSIVE_FORCEINLINE slist_iterator()
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit slist_iterator(const node_ptr & nodeptr, const const_value_traits_ptr &traits_ptr)
|
||||
BOOST_INTRUSIVE_FORCEINLINE slist_iterator(node_ptr nodeptr, const_value_traits_ptr traits_ptr)
|
||||
: members_(nodeptr, traits_ptr)
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit slist_iterator(node_ptr nodeptr)
|
||||
: members_(nodeptr, const_value_traits_ptr())
|
||||
{ BOOST_STATIC_ASSERT((stateful_value_traits == false)); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE slist_iterator(const slist_iterator &other)
|
||||
: members_(other.pointed_node(), other.get_value_traits())
|
||||
{}
|
||||
@@ -83,12 +88,15 @@ class slist_iterator
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr pointed_node() const
|
||||
{ return members_.nodeptr_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE slist_iterator &operator=(const node_ptr &node)
|
||||
{ members_.nodeptr_ = node; return static_cast<slist_iterator&>(*this); }
|
||||
BOOST_INTRUSIVE_FORCEINLINE slist_iterator &operator=(node_ptr n)
|
||||
{ members_.nodeptr_ = n; return static_cast<slist_iterator&>(*this); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE const_value_traits_ptr get_value_traits() const
|
||||
{ return members_.get_ptr(); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE bool operator!() const
|
||||
{ return !members_.nodeptr_; }
|
||||
|
||||
public:
|
||||
BOOST_INTRUSIVE_FORCEINLINE slist_iterator& operator++()
|
||||
{
|
||||
@@ -107,7 +115,7 @@ class slist_iterator
|
||||
{ return l.pointed_node() == r.pointed_node(); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE friend bool operator!= (const slist_iterator& l, const slist_iterator& r)
|
||||
{ return !(l == r); }
|
||||
{ return l.pointed_node() != r.pointed_node(); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE reference operator*() const
|
||||
{ return *operator->(); }
|
||||
|
||||
@@ -46,10 +46,10 @@ struct slist_node_traits
|
||||
typedef typename node::node_ptr node_ptr;
|
||||
typedef typename pointer_rebind<VoidPointer, const node>::type const_node_ptr;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const_node_ptr n)
|
||||
{ return n->next_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(node_ptr n)
|
||||
{ return n->next_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_next(node_ptr n, node_ptr next)
|
||||
|
||||
@@ -71,7 +71,7 @@ class tree_iterator
|
||||
BOOST_INTRUSIVE_FORCEINLINE tree_iterator()
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit tree_iterator(const node_ptr & nodeptr, const const_value_traits_ptr &traits_ptr)
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit tree_iterator(node_ptr nodeptr, const_value_traits_ptr traits_ptr)
|
||||
: members_(nodeptr, traits_ptr)
|
||||
{}
|
||||
|
||||
@@ -86,7 +86,7 @@ class tree_iterator
|
||||
BOOST_INTRUSIVE_FORCEINLINE tree_iterator &operator=(const tree_iterator &other)
|
||||
{ members_.nodeptr_ = other.members_.nodeptr_; return *this; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE tree_iterator &operator=(const node_ptr &nodeptr)
|
||||
BOOST_INTRUSIVE_FORCEINLINE tree_iterator &operator=(node_ptr nodeptr)
|
||||
{ members_.nodeptr_ = nodeptr; return *this; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr pointed_node() const
|
||||
|
||||
@@ -44,28 +44,28 @@ struct tree_node_traits
|
||||
typedef typename node::node_ptr node_ptr;
|
||||
typedef typename pointer_rebind<VoidPointer, const node>::type const_node_ptr;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const_node_ptr n)
|
||||
{ return n->parent_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(node_ptr n)
|
||||
{ return n->parent_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(node_ptr n, node_ptr p)
|
||||
{ n->parent_ = p; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const_node_ptr n)
|
||||
{ return n->left_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(node_ptr n)
|
||||
{ return n->left_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(node_ptr n, node_ptr l)
|
||||
{ n->left_ = l; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const_node_ptr n)
|
||||
{ return n->right_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(node_ptr n)
|
||||
{ return n->right_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(node_ptr n, node_ptr r)
|
||||
|
||||
49
linx64/include/boost/intrusive/detail/twin.hpp
Normal file
49
linx64/include/boost/intrusive/detail/twin.hpp
Normal file
@@ -0,0 +1,49 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2014-2014
|
||||
//
|
||||
// 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_DETAIL_TWIN_HPP
|
||||
#define BOOST_INTRUSIVE_DETAIL_TWIN_HPP
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
# include <boost/config.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//A tiny utility to avoid pulling std::pair / utility for
|
||||
//very simple algorithms/types
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
|
||||
template <class T>
|
||||
struct twin
|
||||
{
|
||||
typedef T type;
|
||||
twin()
|
||||
: first(), second()
|
||||
{}
|
||||
|
||||
twin(const type &f, const type &s)
|
||||
: first(f), second(s)
|
||||
{}
|
||||
|
||||
T first;
|
||||
T second;
|
||||
};
|
||||
|
||||
} //namespace intrusive{
|
||||
} //namespace boost{
|
||||
|
||||
#endif //BOOST_INTRUSIVE_DETAIL_TWIN_HPP
|
||||
52
linx64/include/boost/intrusive/detail/value_functors.hpp
Normal file
52
linx64/include/boost/intrusive/detail/value_functors.hpp
Normal file
@@ -0,0 +1,52 @@
|
||||
#ifndef BOOST_INTRUSIVE_DETAIL_VALUE_FUNCTORS_HPP
|
||||
#define BOOST_INTRUSIVE_DETAIL_VALUE_FUNCTORS_HPP
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2017-2021. 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_CONFIG_HPP
|
||||
# include <boost/config.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
|
||||
//Functors for member algorithm defaults
|
||||
template<class ValueType>
|
||||
struct value_less
|
||||
{
|
||||
bool operator()(const ValueType &a, const ValueType &b) const
|
||||
{ return a < b; }
|
||||
};
|
||||
|
||||
//Functors for member algorithm defaults
|
||||
template<class T>
|
||||
struct value_less<T*>
|
||||
{
|
||||
bool operator()(const T *a, const T* b) const
|
||||
{ return std::size_t(a) < std::size_t(b); }
|
||||
};
|
||||
|
||||
template<class ValueType>
|
||||
struct value_equal
|
||||
{
|
||||
bool operator()(const ValueType &a, const ValueType &b) const
|
||||
{ return a == b; }
|
||||
};
|
||||
|
||||
} //namespace intrusive {
|
||||
} //namespace boost {
|
||||
|
||||
#endif //BOOST_INTRUSIVE_DETAIL_VALUE_FUNCTORS_HPP
|
||||
@@ -23,6 +23,11 @@
|
||||
#include <boost/config.hpp>
|
||||
#endif
|
||||
|
||||
// MSVC-12 ICEs when variadic templates are enabled.
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && (!defined(BOOST_MSVC) || BOOST_MSVC >= 1900)
|
||||
#define BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
#define BOOST_INTRUSIVE_PERFECT_FORWARDING
|
||||
#endif
|
||||
@@ -40,14 +45,40 @@
|
||||
#define BOOST_INTRUSIVE_FORCEINLINE inline
|
||||
#elif defined(BOOST_INTRUSIVE_FORCEINLINE_IS_BOOST_FORCELINE)
|
||||
#define BOOST_INTRUSIVE_FORCEINLINE BOOST_FORCEINLINE
|
||||
#elif defined(BOOST_MSVC) && defined(_DEBUG)
|
||||
//"__forceinline" and MSVC seems to have some bugs in debug mode
|
||||
#elif defined(BOOST_MSVC) && (_MSC_VER < 1900 || defined(_DEBUG))
|
||||
//"__forceinline" and MSVC seems to have some bugs in old versions and in debug mode
|
||||
#define BOOST_INTRUSIVE_FORCEINLINE inline
|
||||
#elif defined(__GNUC__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ < 5)))
|
||||
#elif defined(BOOST_GCC) && ((__GNUC__ <= 5) || defined(__MINGW32__))
|
||||
//Older GCCs have problems with forceinline
|
||||
#define BOOST_INTRUSIVE_FORCEINLINE inline
|
||||
#else
|
||||
#define BOOST_INTRUSIVE_FORCEINLINE BOOST_FORCEINLINE
|
||||
#endif
|
||||
|
||||
#if !(defined BOOST_NO_EXCEPTIONS)
|
||||
# define BOOST_INTRUSIVE_TRY { try
|
||||
# define BOOST_INTRUSIVE_CATCH(x) catch(x)
|
||||
# define BOOST_INTRUSIVE_RETHROW throw;
|
||||
# define BOOST_INTRUSIVE_CATCH_END }
|
||||
#else
|
||||
# if !defined(BOOST_MSVC) || BOOST_MSVC >= 1900
|
||||
# define BOOST_INTRUSIVE_TRY { if (true)
|
||||
# define BOOST_INTRUSIVE_CATCH(x) else if (false)
|
||||
# else
|
||||
// warning C4127: conditional expression is constant
|
||||
# define BOOST_INTRUSIVE_TRY { \
|
||||
__pragma(warning(push)) \
|
||||
__pragma(warning(disable: 4127)) \
|
||||
if (true) \
|
||||
__pragma(warning(pop))
|
||||
# define BOOST_INTRUSIVE_CATCH(x) else \
|
||||
__pragma(warning(push)) \
|
||||
__pragma(warning(disable: 4127)) \
|
||||
if (false) \
|
||||
__pragma(warning(pop))
|
||||
# endif
|
||||
# define BOOST_INTRUSIVE_RETHROW
|
||||
# define BOOST_INTRUSIVE_CATCH_END }
|
||||
#endif
|
||||
|
||||
#endif //#ifndef BOOST_INTRUSIVE_DETAIL_WORKAROUND_HPP
|
||||
|
||||
Reference in New Issue
Block a user