diff --git a/include/boost/intrusive/avltree.hpp b/include/boost/intrusive/avltree.hpp index 4b6e089..e294d58 100644 --- a/include/boost/intrusive/avltree.hpp +++ b/include/boost/intrusive/avltree.hpp @@ -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; } //! Requires: 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; } //! Requires: 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; } //! Requires: 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(); } //! Requires: 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(); } //! Effects: Erases the element pointed to by pos. diff --git a/include/boost/intrusive/detail/tree_node.hpp b/include/boost/intrusive/detail/tree_node.hpp index f6a678d..00993bc 100644 --- a/include/boost/intrusive/detail/tree_node.hpp +++ b/include/boost/intrusive/detail/tree_node.hpp @@ -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) diff --git a/include/boost/intrusive/rbtree.hpp b/include/boost/intrusive/rbtree.hpp index c8e8ab5..d2b5fe8 100644 --- a/include/boost/intrusive/rbtree.hpp +++ b/include/boost/intrusive/rbtree.hpp @@ -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; } //! Requires: 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; } //! Requires: 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); } diff --git a/include/boost/intrusive/sgtree.hpp b/include/boost/intrusive/sgtree.hpp index 5cc361a..2018d0a 100644 --- a/include/boost/intrusive/sgtree.hpp +++ b/include/boost/intrusive/sgtree.hpp @@ -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; } diff --git a/include/boost/intrusive/splaytree.hpp b/include/boost/intrusive/splaytree.hpp index 1cb2a2a..244cb0e 100644 --- a/include/boost/intrusive/splaytree.hpp +++ b/include/boost/intrusive/splaytree.hpp @@ -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; } //! Requires: 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; } //! Requires: 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); } diff --git a/include/boost/intrusive/treap.hpp b/include/boost/intrusive/treap.hpp index 86bdd01..9330b35 100644 --- a/include/boost/intrusive/treap.hpp +++ b/include/boost/intrusive/treap.hpp @@ -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; } //! Requires: 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; } //! Requires: 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 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; } //! Requires: 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 pcomp(priv_pcomp(), this); node_algorithms::push_back(node_ptr(&priv_header()), to_insert, pcomp); + this->priv_size_traits().increment(); } //! Requires: 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 pcomp(priv_pcomp(), this); node_algorithms::push_front(node_ptr(&priv_header()), to_insert, pcomp); + this->priv_size_traits().increment(); } //! Effects: Erases the element pointed to by pos.