Merge from trunk for 1.46

[SVN r68074]
This commit is contained in:
Ion Gaztañaga
2011-01-12 22:24:28 +00:00
parent 225ba8fc16
commit 4a99aa7f6b
6 changed files with 45 additions and 35 deletions

View File

@@ -465,9 +465,10 @@ class avltree_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
return iterator(node_algorithms::insert_equal_upper_bound
iterator ret(node_algorithms::insert_equal_upper_bound
(node_ptr(&priv_header()), to_insert, key_node_comp), this);
this->priv_size_traits().increment();
return ret;
}
//! <b>Requires</b>: value must be an lvalue, and "hint" must be
@@ -491,9 +492,10 @@ class avltree_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
return iterator(node_algorithms::insert_equal
iterator ret(node_algorithms::insert_equal
(node_ptr(&priv_header()), hint.pointed_node(), to_insert, key_node_comp), this);
this->priv_size_traits().increment();
return ret;
}
//! <b>Requires</b>: Dereferencing iterator must yield an lvalue
@@ -698,9 +700,9 @@ class avltree_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
node_algorithms::insert_unique_commit
(node_ptr(&priv_header()), to_insert, commit_data);
this->priv_size_traits().increment();
return iterator(to_insert, this);
}
@@ -723,9 +725,10 @@ class avltree_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
return iterator(node_algorithms::insert_before
iterator ret(node_algorithms::insert_before
(node_ptr(&priv_header()), pos.pointed_node(), to_insert), this);
this->priv_size_traits().increment();
return ret;
}
//! <b>Requires</b>: value must be an lvalue, and it must be no less
@@ -747,8 +750,8 @@ class avltree_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
node_algorithms::push_back(node_ptr(&priv_header()), to_insert);
this->priv_size_traits().increment();
}
//! <b>Requires</b>: value must be an lvalue, and it must be no greater
@@ -770,8 +773,8 @@ class avltree_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
node_algorithms::push_front(node_ptr(&priv_header()), to_insert);
this->priv_size_traits().increment();
}
//! <b>Effects</b>: Erases the element pointed to by pos.

View File

@@ -96,7 +96,7 @@ class tree_iterator
tree_iterator()
: members_ (0, 0)
: members_ (node_ptr(0), (const void *)0)
{}
explicit tree_iterator(node_ptr nodeptr, const Container *cont_ptr)

View File

@@ -478,9 +478,10 @@ class rbtree_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
return iterator(node_algorithms::insert_equal_upper_bound
iterator ret(node_algorithms::insert_equal_upper_bound
(node_ptr(&priv_header()), to_insert, key_node_comp), this);
this->priv_size_traits().increment();
return ret;
}
//! <b>Requires</b>: value must be an lvalue, and "hint" must be
@@ -504,9 +505,10 @@ class rbtree_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
return iterator(node_algorithms::insert_equal
iterator ret(node_algorithms::insert_equal
(node_ptr(&priv_header()), hint.pointed_node(), to_insert, key_node_comp), this);
this->priv_size_traits().increment();
return ret;
}
//! <b>Requires</b>: Dereferencing iterator must yield an lvalue
@@ -711,9 +713,9 @@ class rbtree_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
node_algorithms::insert_unique_commit
(node_ptr(&priv_header()), to_insert, commit_data);
this->priv_size_traits().increment();
return iterator(to_insert, this);
}

View File

@@ -621,11 +621,11 @@ class sgtree_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
std::size_t max_tree_size = (std::size_t)data_.max_tree_size_;
node_ptr p = node_algorithms::insert_equal_upper_bound
(node_ptr(&priv_header()), to_insert, key_node_comp
, (size_type)this->size(), this->get_h_alpha_func(), max_tree_size);
this->priv_size_traits().increment();
data_.max_tree_size_ = (size_type)max_tree_size;
return iterator(p, this);
}
@@ -651,11 +651,11 @@ class sgtree_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
std::size_t max_tree_size = (std::size_t)data_.max_tree_size_;
node_ptr p = node_algorithms::insert_equal
(node_ptr(&priv_header()), hint.pointed_node(), to_insert, key_node_comp
, (std::size_t)this->size(), this->get_h_alpha_func(), max_tree_size);
this->priv_size_traits().increment();
data_.max_tree_size_ = (size_type)max_tree_size;
return iterator(p, this);
}
@@ -862,11 +862,11 @@ class sgtree_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
std::size_t max_tree_size = (std::size_t)data_.max_tree_size_;
node_algorithms::insert_unique_commit
( node_ptr(&priv_header()), to_insert, commit_data
, (std::size_t)this->size(), this->get_h_alpha_func(), max_tree_size);
this->priv_size_traits().increment();
data_.max_tree_size_ = (size_type)max_tree_size;
return iterator(to_insert, this);
}
@@ -890,11 +890,11 @@ class sgtree_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
std::size_t max_tree_size = (std::size_t)data_.max_tree_size_;
node_ptr p = node_algorithms::insert_before
( node_ptr(&priv_header()), pos.pointed_node(), to_insert
, (size_type)this->size(), this->get_h_alpha_func(), max_tree_size);
this->priv_size_traits().increment();
data_.max_tree_size_ = (size_type)max_tree_size;
return iterator(p, this);
}
@@ -918,11 +918,11 @@ class sgtree_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
std::size_t max_tree_size = (std::size_t)data_.max_tree_size_;
node_algorithms::push_back
( node_ptr(&priv_header()), to_insert
, (size_type)this->size(), this->get_h_alpha_func(), max_tree_size);
this->priv_size_traits().increment();
data_.max_tree_size_ = (size_type)max_tree_size;
}
@@ -945,11 +945,11 @@ class sgtree_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
std::size_t max_tree_size = (std::size_t)data_.max_tree_size_;
node_algorithms::push_front
( node_ptr(&priv_header()), to_insert
, (size_type)this->size(), this->get_h_alpha_func(), max_tree_size);
this->priv_size_traits().increment();
data_.max_tree_size_ = (size_type)max_tree_size;
}

View File

@@ -466,9 +466,10 @@ class splaytree_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
return iterator(node_algorithms::insert_equal_lower_bound
iterator ret (node_algorithms::insert_equal_lower_bound
(node_ptr(&priv_header()), to_insert, key_node_comp), this);
this->priv_size_traits().increment();
return ret;
}
//! <b>Requires</b>: value must be an lvalue, and "hint" must be
@@ -492,9 +493,10 @@ class splaytree_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
return iterator(node_algorithms::insert_equal
iterator ret(node_algorithms::insert_equal
(node_ptr(&priv_header()), hint.pointed_node(), to_insert, key_node_comp), this);
this->priv_size_traits().increment();
return ret;
}
//! <b>Requires</b>: Dereferencing iterator must yield an lvalue
@@ -693,9 +695,9 @@ class splaytree_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
node_algorithms::insert_unique_commit
(node_ptr(&priv_header()), to_insert, commit_data);
this->priv_size_traits().increment();
return iterator(to_insert, this);
}

View File

@@ -549,9 +549,10 @@ class treap_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
return iterator(node_algorithms::insert_equal_upper_bound
iterator ret(node_algorithms::insert_equal_upper_bound
(node_ptr(&priv_header()), to_insert, key_node_comp, key_node_pcomp), this);
this->priv_size_traits().increment();
return ret;
}
//! <b>Requires</b>: value must be an lvalue, and "hint" must be
@@ -577,9 +578,10 @@ class treap_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
return iterator(node_algorithms::insert_equal
iterator ret (node_algorithms::insert_equal
(node_ptr(&priv_header()), hint.pointed_node(), to_insert, key_node_comp, key_node_pcomp), this);
this->priv_size_traits().increment();
return ret;
}
//! <b>Requires</b>: Dereferencing iterator must yield an lvalue
@@ -801,8 +803,8 @@ class treap_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
node_algorithms::insert_unique_commit(node_ptr(&priv_header()), to_insert, commit_data);
this->priv_size_traits().increment();
return iterator(to_insert, this);
}
@@ -825,11 +827,12 @@ class treap_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
detail::key_nodeptr_comp<priority_compare, treap_impl>
pcomp(priv_pcomp(), this);
return iterator(node_algorithms::insert_before
iterator ret (node_algorithms::insert_before
(node_ptr(&priv_header()), pos.pointed_node(), to_insert, pcomp), this);
this->priv_size_traits().increment();
return ret;
}
//! <b>Requires</b>: value must be an lvalue, and it must be no less
@@ -851,10 +854,10 @@ class treap_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
detail::key_nodeptr_comp<priority_compare, treap_impl>
pcomp(priv_pcomp(), this);
node_algorithms::push_back(node_ptr(&priv_header()), to_insert, pcomp);
this->priv_size_traits().increment();
}
//! <b>Requires</b>: value must be an lvalue, and it must be no greater
@@ -876,10 +879,10 @@ class treap_impl
node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
this->priv_size_traits().increment();
detail::key_nodeptr_comp<priority_compare, treap_impl>
pcomp(priv_pcomp(), this);
node_algorithms::push_front(node_ptr(&priv_header()), to_insert, pcomp);
this->priv_size_traits().increment();
}
//! <b>Effects</b>: Erases the element pointed to by pos.