diff --git a/include/boost/intrusive/avltree_algorithms.hpp b/include/boost/intrusive/avltree_algorithms.hpp index d360a20..a6a059c 100644 --- a/include/boost/intrusive/avltree_algorithms.hpp +++ b/include/boost/intrusive/avltree_algorithms.hpp @@ -46,14 +46,14 @@ struct avltree_node_cloner : base_t(f) {} - BOOST_INTRUSIVE_FORCEINLINE node_ptr operator()(const node_ptr & p) + BOOST_INTRUSIVE_FORCEINLINE node_ptr operator()(node_ptr p) { node_ptr n = base_t::get()(p); NodeTraits::set_balance(n, NodeTraits::get_balance(p)); return n; } - BOOST_INTRUSIVE_FORCEINLINE node_ptr operator()(const node_ptr & p) const + BOOST_INTRUSIVE_FORCEINLINE node_ptr operator()(node_ptr p) const { node_ptr n = base_t::get()(p); NodeTraits::set_balance(n, NodeTraits::get_balance(p)); @@ -83,7 +83,7 @@ struct avltree_node_checker : base_checker_t(comp, extra_checker) {} - void operator () (const const_node_ptr& p, + void operator () (const_node_ptr p, const return_type& check_return_left, const return_type& check_return_right, return_type& check_return) { @@ -166,14 +166,14 @@ class avltree_algorithms #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED - //! @copydoc ::boost::intrusive::bstree_algorithms::get_header(const const_node_ptr&) - static node_ptr get_header(const const_node_ptr & n) BOOST_NOEXCEPT; + //! @copydoc ::boost::intrusive::bstree_algorithms::get_header(const_node_ptr) + static node_ptr get_header(const_node_ptr n) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::begin_node - static node_ptr begin_node(const const_node_ptr & header) BOOST_NOEXCEPT; + static node_ptr begin_node(const_node_ptr header) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::end_node - static node_ptr end_node(const const_node_ptr & header) BOOST_NOEXCEPT; + static node_ptr end_node(const_node_ptr header) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::swap_tree static void swap_tree(node_ptr header1, node_ptr header2) BOOST_NOEXCEPT; @@ -230,22 +230,22 @@ class avltree_algorithms #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree_algorithms::unlink_leftmost_without_rebalance - static node_ptr unlink_leftmost_without_rebalance(const node_ptr & header) BOOST_NOEXCEPT; + static node_ptr unlink_leftmost_without_rebalance(node_ptr header) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::unique(const const_node_ptr&) - static bool unique(const const_node_ptr & node) BOOST_NOEXCEPT; + //! @copydoc ::boost::intrusive::bstree_algorithms::unique(const_node_ptr) + static bool unique(const_node_ptr node) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::size(const const_node_ptr&) - static std::size_t size(const const_node_ptr & header) BOOST_NOEXCEPT; + //! @copydoc ::boost::intrusive::bstree_algorithms::size(const_node_ptr) + static std::size_t size(const_node_ptr header) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::next_node(const node_ptr&) - static node_ptr next_node(const node_ptr & node) BOOST_NOEXCEPT; + //! @copydoc ::boost::intrusive::bstree_algorithms::next_node(node_ptr) + static node_ptr next_node(node_ptr node) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::prev_node(const node_ptr&) - static node_ptr prev_node(const node_ptr & node) BOOST_NOEXCEPT; + //! @copydoc ::boost::intrusive::bstree_algorithms::prev_node(node_ptr) + static node_ptr prev_node(node_ptr node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::init(node_ptr) - static void init(const node_ptr & node) BOOST_NOEXCEPT; + static void init(node_ptr node) BOOST_NOEXCEPT; #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! Requires: node must not be part of any tree. @@ -298,49 +298,49 @@ class avltree_algorithms rebalance_after_insertion(header1, z); } - //! @copydoc ::boost::intrusive::bstree_algorithms::clone(const const_node_ptr&,node_ptr,Cloner,Disposer) + //! @copydoc ::boost::intrusive::bstree_algorithms::clone(const_node_ptr,node_ptr,Cloner,Disposer) template static void clone - (const const_node_ptr & source_header, node_ptr target_header, Cloner cloner, Disposer disposer) + (const_node_ptr source_header, node_ptr target_header, Cloner cloner, Disposer disposer) { avltree_node_cloner new_cloner(cloner); bstree_algo::clone(source_header, target_header, new_cloner, disposer); } #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED - //! @copydoc ::boost::intrusive::bstree_algorithms::clear_and_dispose(const node_ptr&,Disposer) + //! @copydoc ::boost::intrusive::bstree_algorithms::clear_and_dispose(node_ptr,Disposer) template - static void clear_and_dispose(const node_ptr & header, Disposer disposer) BOOST_NOEXCEPT; + static void clear_and_dispose(node_ptr header, Disposer disposer) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound(const_node_ptr,const KeyType&,KeyNodePtrCompare) template static node_ptr lower_bound - (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp); + (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); - //! @copydoc ::boost::intrusive::bstree_algorithms::upper_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::upper_bound(const_node_ptr,const KeyType&,KeyNodePtrCompare) template static node_ptr upper_bound - (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp); + (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); - //! @copydoc ::boost::intrusive::bstree_algorithms::find(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::find(const_node_ptr,const KeyType&,KeyNodePtrCompare) template static node_ptr find - (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp); + (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); - //! @copydoc ::boost::intrusive::bstree_algorithms::equal_range(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::equal_range(const_node_ptr,const KeyType&,KeyNodePtrCompare) template static std::pair equal_range - (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp); + (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); - //! @copydoc ::boost::intrusive::bstree_algorithms::bounded_range(const const_node_ptr&,const KeyType&,const KeyType&,KeyNodePtrCompare,bool,bool) + //! @copydoc ::boost::intrusive::bstree_algorithms::bounded_range(const_node_ptr,const KeyType&,const KeyType&,KeyNodePtrCompare,bool,bool) template static std::pair bounded_range - (const const_node_ptr & header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp + (const_node_ptr header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp , bool left_closed, bool right_closed); - //! @copydoc ::boost::intrusive::bstree_algorithms::count(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::count(const_node_ptr,const KeyType&,KeyNodePtrCompare) template - static std::size_t count(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp); + static std::size_t count(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED @@ -398,16 +398,16 @@ class avltree_algorithms } #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED - //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const const_node_ptr&,const KeyType&,KeyNodePtrCompare,insert_commit_data&) + //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const_node_ptr,const KeyType&,KeyNodePtrCompare,insert_commit_data&) template static std::pair insert_unique_check - (const const_node_ptr & header, const KeyType &key + (const_node_ptr header, const KeyType &key ,KeyNodePtrCompare comp, insert_commit_data &commit_data); - //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const const_node_ptr&,const node_ptr&,const KeyType&,KeyNodePtrCompare,insert_commit_data&) + //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const_node_ptr,node_ptr,const KeyType&,KeyNodePtrCompare,insert_commit_data&) template static std::pair insert_unique_check - (const const_node_ptr & header, const node_ptr &hint, const KeyType &key + (const_node_ptr header, node_ptr hint, const KeyType &key ,KeyNodePtrCompare comp, insert_commit_data &commit_data); #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED @@ -420,12 +420,12 @@ class avltree_algorithms } //! @copydoc ::boost::intrusive::bstree_algorithms::is_header - static bool is_header(const const_node_ptr & p) BOOST_NOEXCEPT + static bool is_header(const_node_ptr p) BOOST_NOEXCEPT { return NodeTraits::get_balance(p) == NodeTraits::zero() && bstree_algo::is_header(p); } /// @cond - static bool verify(const node_ptr &header) + static bool verify(node_ptr header) { std::size_t height; std::size_t count; diff --git a/include/boost/intrusive/bstree.hpp b/include/boost/intrusive/bstree.hpp index de604dd..51687eb 100644 --- a/include/boost/intrusive/bstree.hpp +++ b/include/boost/intrusive/bstree.hpp @@ -202,8 +202,8 @@ struct bstbase3 BOOST_INTRUSIVE_FORCEINLINE void rebalance() BOOST_NOEXCEPT { node_algorithms::rebalance(this->header_ptr()); } - iterator rebalance_subtree(iterator root) BOOST_NOEXCEPT - { return iterator(node_algorithms::rebalance_subtree(root.pointed_node()), this->priv_value_traits_ptr()); } + iterator rebalance_subtree(iterator r) BOOST_NOEXCEPT + { return iterator(node_algorithms::rebalance_subtree(r.pointed_node()), this->priv_value_traits_ptr()); } static iterator s_iterator_to(reference value) BOOST_NOEXCEPT { @@ -301,10 +301,10 @@ struct bstbase2 : detail::ebo_functor_holder(value_compare(comp)), treeheader_t(vtraits) {} - const value_compare &comp() const + const value_compare &get_comp() const { return this->get(); } - value_compare &comp() + value_compare &get_comp() { return this->get(); } typedef BOOST_INTRUSIVE_IMPDEF(typename value_traits::pointer) pointer; @@ -315,10 +315,10 @@ struct bstbase2 typedef typename node_algorithms::insert_commit_data insert_commit_data; BOOST_INTRUSIVE_FORCEINLINE value_compare value_comp() const - { return this->comp(); } + { return this->get_comp(); } BOOST_INTRUSIVE_FORCEINLINE key_compare key_comp() const - { return this->comp().key_comp(); } + { return this->get_comp().key_comp(); } //lower_bound BOOST_INTRUSIVE_FORCEINLINE iterator lower_bound(const key_type &key) @@ -400,8 +400,8 @@ struct bstbase2 template std::pair equal_range(const KeyType &key, KeyTypeKeyCompare comp) { - std::pair ret - (node_algorithms::equal_range(this->header_ptr(), key, this->key_node_comp(comp))); + std::pair ret = + node_algorithms::equal_range(this->header_ptr(), key, this->key_node_comp(comp)); return std::pair( iterator(ret.first, this->priv_value_traits_ptr()) , iterator(ret.second, this->priv_value_traits_ptr())); } @@ -414,8 +414,8 @@ struct bstbase2 std::pair equal_range(const KeyType &key, KeyTypeKeyCompare comp) const { - std::pair ret - (node_algorithms::equal_range(this->header_ptr(), key, this->key_node_comp(comp))); + std::pair ret = + node_algorithms::equal_range(this->header_ptr(), key, this->key_node_comp(comp)); return std::pair( const_iterator(ret.first, this->priv_value_traits_ptr()) , const_iterator(ret.second, this->priv_value_traits_ptr())); } @@ -427,8 +427,8 @@ struct bstbase2 template std::pair lower_bound_range(const KeyType &key, KeyTypeKeyCompare comp) { - std::pair ret - (node_algorithms::lower_bound_range(this->header_ptr(), key, this->key_node_comp(comp))); + std::pair ret = + node_algorithms::lower_bound_range(this->header_ptr(), key, this->key_node_comp(comp)); return std::pair( iterator(ret.first, this->priv_value_traits_ptr()) , iterator(ret.second, this->priv_value_traits_ptr())); } @@ -441,8 +441,8 @@ struct bstbase2 std::pair lower_bound_range(const KeyType &key, KeyTypeKeyCompare comp) const { - std::pair ret - (node_algorithms::lower_bound_range(this->header_ptr(), key, this->key_node_comp(comp))); + std::pair ret = + node_algorithms::lower_bound_range(this->header_ptr(), key, this->key_node_comp(comp)); return std::pair( const_iterator(ret.first, this->priv_value_traits_ptr()) , const_iterator(ret.second, this->priv_value_traits_ptr())); } @@ -456,9 +456,9 @@ struct bstbase2 std::pair bounded_range (const KeyType &lower_key, const KeyType &upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) { - std::pair ret - (node_algorithms::bounded_range - (this->header_ptr(), lower_key, upper_key, this->key_node_comp(comp), left_closed, right_closed)); + std::pair ret = + node_algorithms::bounded_range + (this->header_ptr(), lower_key, upper_key, this->key_node_comp(comp), left_closed, right_closed); return std::pair( iterator(ret.first, this->priv_value_traits_ptr()) , iterator(ret.second, this->priv_value_traits_ptr())); } @@ -471,9 +471,9 @@ struct bstbase2 std::pair bounded_range (const KeyType &lower_key, const KeyType &upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const { - std::pair ret - (node_algorithms::bounded_range - (this->header_ptr(), lower_key, upper_key, this->key_node_comp(comp), left_closed, right_closed)); + std::pair ret = + node_algorithms::bounded_range + (this->header_ptr(), lower_key, upper_key, this->key_node_comp(comp), left_closed, right_closed); return std::pair( const_iterator(ret.first, this->priv_value_traits_ptr()) , const_iterator(ret.second, this->priv_value_traits_ptr())); } @@ -735,7 +735,7 @@ class bstree_impl //! move constructor throws (this does not happen with predefined Boost.Intrusive hooks) //! or the move constructor of the comparison objet throws. bstree_impl(BOOST_RV_REF(bstree_impl) x) - : data_type(::boost::move(x.comp()), ::boost::move(x.get_value_traits())) + : data_type(::boost::move(x.get_comp()), ::boost::move(x.get_value_traits())) { this->swap(x); } @@ -975,7 +975,7 @@ class bstree_impl void swap(bstree_impl& other) { //This can throw - ::boost::adl_move_swap(this->comp(), other.comp()); + ::boost::adl_move_swap(this->get_comp(), other.get_comp()); //These can't throw node_algorithms::swap_tree(this->header_ptr(), node_ptr(other.header_ptr())); this->sz_traits().swap(other.sz_traits()); @@ -1008,7 +1008,7 @@ class bstree_impl ,detail::node_cloner (cloner, &this->get_value_traits()) ,detail::node_disposer(disposer, &this->get_value_traits())); this->sz_traits().set_size(src.sz_traits().get_size()); - this->comp() = src.comp(); + this->get_comp() = src.get_comp(); rollback.release(); } } @@ -1043,7 +1043,7 @@ class bstree_impl ,detail::node_cloner (cloner, &this->get_value_traits()) ,detail::node_disposer(disposer, &this->get_value_traits())); this->sz_traits().set_size(src.sz_traits().get_size()); - this->comp() = src.comp(); + this->get_comp() = src.get_comp(); rollback.release(); } } @@ -1325,8 +1325,8 @@ class bstree_impl } //Check if the insertion point is correct to detect wrong //uses insert_unique_check - BOOST_ASSERT(( p == this->end() || !this->comp()(*p, value) )); - BOOST_ASSERT(( p == this->begin() || !this->comp()(value, *--p) )); + BOOST_ASSERT(( p == this->end() || !this->get_comp()(*p, value) )); + BOOST_ASSERT(( p == this->begin() || !this->get_comp()(value, *--p) )); #endif node_algorithms::insert_unique_commit @@ -1943,7 +1943,7 @@ class bstree_impl //! Throws: Nothing. //! //! Complexity: Linear to the elements in the subtree. - iterator rebalance_subtree(iterator root) BOOST_NOEXCEPT; + iterator rebalance_subtree(iterator r) BOOST_NOEXCEPT; #endif //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) diff --git a/include/boost/intrusive/bstree_algorithms.hpp b/include/boost/intrusive/bstree_algorithms.hpp index 350b2e4..ecb070e 100644 --- a/include/boost/intrusive/bstree_algorithms.hpp +++ b/include/boost/intrusive/bstree_algorithms.hpp @@ -80,7 +80,7 @@ struct bstree_node_checker : base_checker_t(extra_checker), comp_(comp) {} - void operator () (const const_node_ptr& p, + void operator () (const_node_ptr p, const return_type& check_return_left, const return_type& check_return_right, return_type& check_return) { @@ -186,7 +186,7 @@ class bstree_algorithms : public bstree_algorithms_base template struct dispose_subtree_disposer { - BOOST_INTRUSIVE_FORCEINLINE dispose_subtree_disposer(Disposer &disp, const node_ptr & subtree) + BOOST_INTRUSIVE_FORCEINLINE dispose_subtree_disposer(Disposer &disp, node_ptr subtree) : disposer_(&disp), subtree_(subtree) {} @@ -213,7 +213,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Constant time. //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static node_ptr begin_node(const const_node_ptr & header) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static node_ptr begin_node(const_node_ptr header) BOOST_NOEXCEPT { return node_traits::get_left(header); } //! Requires: 'header' is the header node of a tree. @@ -223,7 +223,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Constant time. //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static node_ptr end_node(const const_node_ptr & header) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static node_ptr end_node(const_node_ptr header) BOOST_NOEXCEPT { return detail::uncast(header); } //! Requires: 'header' is the header node of a tree. @@ -233,7 +233,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Constant time. //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static node_ptr root_node(const const_node_ptr & header) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr root_node(const_node_ptr header) { node_ptr p = node_traits::get_parent(header); return p ? p : detail::uncast(header); @@ -247,7 +247,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Constant time. //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static bool unique(const const_node_ptr & node) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static bool unique(const_node_ptr node) BOOST_NOEXCEPT { return !NodeTraits::get_parent(node); } #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) @@ -258,7 +258,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Logarithmic. //! //! Throws: Nothing. - static node_ptr get_header(const const_node_ptr & node); + static node_ptr get_header(const_node_ptr node); #endif //! Requires: node1 and node2 can't be header nodes @@ -528,7 +528,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Average constant time. //! //! Throws: Nothing. - static node_ptr next_node(const node_ptr & node) BOOST_NOEXCEPT; + static node_ptr next_node(node_ptr node) BOOST_NOEXCEPT; //! Requires: 'node' is a node from the tree except the leftmost node. //! @@ -537,7 +537,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Average constant time. //! //! Throws: Nothing. - static node_ptr prev_node(const node_ptr & node) BOOST_NOEXCEPT; + static node_ptr prev_node(node_ptr node) BOOST_NOEXCEPT; //! Requires: 'node' is a node of a tree but not the header. //! @@ -579,7 +579,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Constant. //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static bool inited(const const_node_ptr & node) + BOOST_INTRUSIVE_FORCEINLINE static bool inited(const_node_ptr node) { return !NodeTraits::get_parent(node) && !NodeTraits::get_left(node) && @@ -607,7 +607,7 @@ class bstree_algorithms : public bstree_algorithms_base //! taking a node_ptr parameter and shouldn't throw. //! //! Effects: Empties the target tree calling - //! void disposer::operator()(const node_ptr &) for every node of the tree + //! void disposer::operator()(node_ptr) for every node of the tree //! except the header. //! //! Complexity: Linear to the number of element of the source tree plus the. @@ -615,7 +615,7 @@ class bstree_algorithms : public bstree_algorithms_base //! //! Throws: Nothing. template - static void clear_and_dispose(const node_ptr & header, Disposer disposer) BOOST_NOEXCEPT + static void clear_and_dispose(node_ptr header, Disposer disposer) BOOST_NOEXCEPT { node_ptr source_root = NodeTraits::get_parent(header); if(!source_root) @@ -674,7 +674,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Linear time. //! //! Throws: Nothing. - static std::size_t size(const const_node_ptr & header) BOOST_NOEXCEPT + static std::size_t size(const_node_ptr header) BOOST_NOEXCEPT { node_ptr beg(begin_node(header)); node_ptr end(end_node(header)); @@ -740,7 +740,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Constant. //! //! Throws: Nothing. - static bool is_header(const const_node_ptr & p) BOOST_NOEXCEPT; + static bool is_header(const_node_ptr p) BOOST_NOEXCEPT; #endif //! Requires: "header" must be the header node of a tree. @@ -756,7 +756,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Throws: If "comp" throws. template static node_ptr find - (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp) + (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp) { node_ptr end = detail::uncast(header); node_ptr y = lower_bound(header, key, comp); @@ -786,7 +786,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Note: Experimental function, the interface might change. template< class KeyType, class KeyNodePtrCompare> static std::pair bounded_range - ( const const_node_ptr & header + ( const_node_ptr header , const KeyType &lower_key , const KeyType &upper_key , KeyNodePtrCompare comp @@ -853,7 +853,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Throws: If "comp" throws. template static std::size_t count - (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp) + (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp) { std::pair ret = equal_range(header, key, comp); std::size_t n = 0; @@ -879,7 +879,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Throws: If "comp" throws. template BOOST_INTRUSIVE_FORCEINLINE static std::pair equal_range - (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp) + (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp) { return bounded_range(header, key, key, comp, true, true); } @@ -899,7 +899,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Throws: If "comp" throws. template static std::pair lower_bound_range - (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp) + (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp) { node_ptr const lb(lower_bound(header, key, comp)); std::pair ret_ii(lb, lb); @@ -923,7 +923,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Throws: If "comp" throws. template BOOST_INTRUSIVE_FORCEINLINE static node_ptr lower_bound - (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp) + (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp) { return lower_bound_loop(NodeTraits::get_parent(header), detail::uncast(header), key, comp); } @@ -941,7 +941,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Throws: If "comp" throws. template BOOST_INTRUSIVE_FORCEINLINE static node_ptr upper_bound - (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp) + (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp) { return upper_bound_loop(NodeTraits::get_parent(header), detail::uncast(header), key, comp); } @@ -1003,7 +1003,7 @@ class bstree_algorithms : public bstree_algorithms_base //! if no more objects are inserted or erased from the set. template static std::pair insert_unique_check - (const const_node_ptr & header, const KeyType &key + (const_node_ptr header, const KeyType &key ,KeyNodePtrCompare comp, insert_commit_data &commit_data #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED , std::size_t *pdepth = 0 @@ -1081,7 +1081,7 @@ class bstree_algorithms : public bstree_algorithms_base //! if no more objects are inserted or erased from the set. template static std::pair insert_unique_check - (const const_node_ptr & header, const node_ptr &hint, const KeyType &key + (const_node_ptr header, node_ptr hint, const KeyType &key ,KeyNodePtrCompare comp, insert_commit_data &commit_data #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED , std::size_t *pdepth = 0 @@ -1287,13 +1287,13 @@ class bstree_algorithms : public bstree_algorithms_base //! take a node_ptr and shouldn't throw. //! //! Effects: First empties target tree calling - //! void disposer::operator()(const node_ptr &) for every node of the tree + //! void disposer::operator()(node_ptr) for every node of the tree //! except the header. //! //! Then, duplicates the entire tree pointed by "source_header" cloning each - //! source node with node_ptr Cloner::operator()(const node_ptr &) to obtain + //! source node with node_ptr Cloner::operator()(node_ptr) to obtain //! the nodes of the target tree. If "cloner" throws, the cloned target nodes - //! are disposed using void disposer(const node_ptr &). + //! are disposed using void disposer(node_ptr ). //! //! Complexity: Linear to the number of element of the source tree plus the //! number of elements of tree target tree when calling this function. @@ -1301,7 +1301,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Throws: If cloner functor throws. If this happens target nodes are disposed. template static void clone - (const const_node_ptr & source_header, node_ptr target_header, Cloner cloner, Disposer disposer) + (const_node_ptr source_header, node_ptr target_header, Cloner cloner, Disposer disposer) { if(!unique(target_header)){ clear_and_dispose(target_header, disposer); @@ -1458,7 +1458,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Note: The method might not have effect when asserts are turned off (e.g., with NDEBUG). //! Experimental function, interface might change in future versions. template - static void check(const const_node_ptr& header, Checker checker, typename Checker::return_type& checker_return) + static void check(const_node_ptr header, Checker checker, typename Checker::return_type& checker_return) { const_node_ptr root_node_ptr = NodeTraits::get_parent(header); if (!root_node_ptr){ @@ -1595,7 +1595,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Linear time. //! //! Throws: Nothing. - static std::size_t subtree_size(const const_node_ptr & subtree) BOOST_NOEXCEPT + static std::size_t subtree_size(const_node_ptr subtree) BOOST_NOEXCEPT { std::size_t count = 0; if (subtree){ @@ -1638,7 +1638,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Constant. //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static bool is_left_child(const node_ptr & p) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static bool is_left_child(node_ptr p) BOOST_NOEXCEPT { return NodeTraits::get_left(NodeTraits::get_parent(p)) == p; } //! Requires: p is a node of a tree. @@ -1648,7 +1648,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Constant. //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static bool is_right_child(const node_ptr & p) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static bool is_right_child(node_ptr p) BOOST_NOEXCEPT { return NodeTraits::get_right(NodeTraits::get_parent(p)) == p; } static void insert_before_check @@ -1919,7 +1919,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Logarithmic. //! //! Throws: Nothing. - static node_ptr get_root(const node_ptr & node) BOOST_NOEXCEPT + static node_ptr get_root(node_ptr node) BOOST_NOEXCEPT { BOOST_INTRUSIVE_INVARIANT_ASSERT((!inited(node))); node_ptr x = NodeTraits::get_parent(node); @@ -1936,7 +1936,7 @@ class bstree_algorithms : public bstree_algorithms_base template static node_ptr clone_subtree - (const const_node_ptr &source_parent, node_ptr target_parent + (const_node_ptr source_parent, node_ptr target_parent , Cloner cloner, Disposer disposer , node_ptr &leftmost_out, node_ptr &rightmost_out ) @@ -2062,7 +2062,7 @@ class bstree_algorithms : public bstree_algorithms_base } template - static void check_subtree(const const_node_ptr& node, Checker checker, typename Checker::return_type& check_return) + static void check_subtree(const_node_ptr node, Checker checker, typename Checker::return_type& check_return) { const_node_ptr left = NodeTraits::get_left(node); const_node_ptr right = NodeTraits::get_right(node); diff --git a/include/boost/intrusive/circular_list_algorithms.hpp b/include/boost/intrusive/circular_list_algorithms.hpp index 657f1a7..c8e57f9 100644 --- a/include/boost/intrusive/circular_list_algorithms.hpp +++ b/include/boost/intrusive/circular_list_algorithms.hpp @@ -80,7 +80,7 @@ class circular_list_algorithms //! Complexity: Constant //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static bool inited(const const_node_ptr &this_node) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static bool inited(const_node_ptr this_node) BOOST_NOEXCEPT { return !NodeTraits::get_next(this_node); } //! Effects: Constructs an empty list, making this_node the only @@ -105,7 +105,7 @@ class circular_list_algorithms //! Complexity: Constant //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static bool unique(const const_node_ptr &this_node) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static bool unique(const_node_ptr this_node) BOOST_NOEXCEPT { node_ptr next = NodeTraits::get_next(this_node); return !next || next == this_node; @@ -119,7 +119,7 @@ class circular_list_algorithms //! Complexity: Linear //! //! Throws: Nothing. - static std::size_t count(const const_node_ptr &this_node) BOOST_NOEXCEPT + static std::size_t count(const_node_ptr this_node) BOOST_NOEXCEPT { std::size_t result = 0; const_node_ptr p = this_node; @@ -358,12 +358,11 @@ class circular_list_algorithms //! Complexity: Linear //! //! Throws: Nothing. - static std::size_t distance(const const_node_ptr &f, const const_node_ptr &l) BOOST_NOEXCEPT + 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; - while(i != l){ - i = NodeTraits::get_next(i); + while(f != l){ + f = NodeTraits::get_next(f); ++result; } return result; diff --git a/include/boost/intrusive/circular_slist_algorithms.hpp b/include/boost/intrusive/circular_slist_algorithms.hpp index 8c0bc8b..571ad8d 100644 --- a/include/boost/intrusive/circular_slist_algorithms.hpp +++ b/include/boost/intrusive/circular_slist_algorithms.hpp @@ -153,7 +153,7 @@ class circular_slist_algorithms //! Complexity: Linear to the number of elements between prev_init_node and this_node. //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous_node(const node_ptr &prev_init_node, const node_ptr &this_node) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous_node(node_ptr prev_init_node, node_ptr this_node) BOOST_NOEXCEPT { return base_t::get_previous_node(prev_init_node, this_node); } //! Requires: this_node must be in a circular list or be an empty circular list. @@ -163,7 +163,7 @@ class circular_slist_algorithms //! Complexity: Linear to the number of elements in the circular list. //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous_node(const node_ptr & this_node) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous_node(node_ptr this_node) BOOST_NOEXCEPT { return base_t::get_previous_node(this_node, this_node); } //! Requires: this_node must be in a circular list or be an empty circular list. @@ -173,7 +173,7 @@ class circular_slist_algorithms //! Complexity: Linear to the number of elements in the circular list. //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous_previous_node(const node_ptr & this_node) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous_previous_node(node_ptr this_node) BOOST_NOEXCEPT { return get_previous_previous_node(this_node, this_node); } //! Requires: this_node and p must be in the same circular list. @@ -185,7 +185,7 @@ class circular_slist_algorithms //! Complexity: Linear to the number of elements in the circular list. //! //! Throws: Nothing. - static node_ptr get_previous_previous_node(node_ptr p, const node_ptr & this_node) BOOST_NOEXCEPT + static node_ptr get_previous_previous_node(node_ptr p, node_ptr this_node) BOOST_NOEXCEPT { node_ptr p_next = NodeTraits::get_next(p); node_ptr p_next_next = NodeTraits::get_next(p_next); @@ -205,7 +205,7 @@ class circular_slist_algorithms //! Complexity: Linear //! //! Throws: Nothing. - static std::size_t count(const const_node_ptr & this_node) BOOST_NOEXCEPT + static std::size_t count(const_node_ptr this_node) BOOST_NOEXCEPT { std::size_t result = 0; const_node_ptr p = this_node; diff --git a/include/boost/intrusive/derivation_value_traits.hpp b/include/boost/intrusive/derivation_value_traits.hpp index d3eb100..6260312 100644 --- a/include/boost/intrusive/derivation_value_traits.hpp +++ b/include/boost/intrusive/derivation_value_traits.hpp @@ -58,12 +58,12 @@ struct derivation_value_traits BOOST_INTRUSIVE_FORCEINLINE static const_node_ptr to_node_ptr(const_reference value) BOOST_NOEXCEPT { return node_ptr(&value); } - BOOST_INTRUSIVE_FORCEINLINE static pointer to_value_ptr(const node_ptr &n) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static pointer to_value_ptr(node_ptr n) BOOST_NOEXCEPT { return pointer_traits::pointer_to(static_cast(*n)); } - BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const const_node_ptr &n) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const_node_ptr n) BOOST_NOEXCEPT { return pointer_traits::pointer_to(static_cast(*n)); } diff --git a/include/boost/intrusive/detail/any_node_and_algorithms.hpp b/include/boost/intrusive/detail/any_node_and_algorithms.hpp index 1dbcbd7..36a03d5 100644 --- a/include/boost/intrusive/detail/any_node_and_algorithms.hpp +++ b/include/boost/intrusive/detail/any_node_and_algorithms.hpp @@ -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) @@ -252,7 +252,7 @@ class any_algorithms //! Throws: Nothing. //! //! Nodes: If node is inserted in a tree, this function corrupts the tree. - BOOST_INTRUSIVE_FORCEINLINE static void init(const node_ptr & node) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static void init(node_ptr node) BOOST_NOEXCEPT { node->node_ptr_1 = node_ptr(); }; //! Effects: Returns true if node is in the same state as if called init(node) @@ -260,19 +260,19 @@ class any_algorithms //! Complexity: Constant. //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static bool inited(const const_node_ptr & node) + BOOST_INTRUSIVE_FORCEINLINE static bool inited(const_node_ptr node) { return !node->node_ptr_1; }; - BOOST_INTRUSIVE_FORCEINLINE static bool unique(const const_node_ptr & node) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static bool unique(const_node_ptr node) BOOST_NOEXCEPT { return !node->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::template function_not_available_for_any_hooks(); } - 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 diff --git a/include/boost/intrusive/detail/avltree_node.hpp b/include/boost/intrusive/detail/avltree_node.hpp index 85a8642..b9c52dc 100644 --- a/include/boost/intrusive/detail/avltree_node.hpp +++ b/include/boost/intrusive/detail/avltree_node.hpp @@ -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 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() diff --git a/include/boost/intrusive/detail/bstree_algorithms_base.hpp b/include/boost/intrusive/detail/bstree_algorithms_base.hpp index f8d8dfc..023d870 100644 --- a/include/boost/intrusive/detail/bstree_algorithms_base.hpp +++ b/include/boost/intrusive/detail/bstree_algorithms_base.hpp @@ -42,7 +42,7 @@ class bstree_algorithms_base //! Complexity: Average constant time. //! //! Throws: Nothing. - static node_ptr next_node(const node_ptr & node) BOOST_NOEXCEPT + static node_ptr next_node(node_ptr node) BOOST_NOEXCEPT { node_ptr const n_right(NodeTraits::get_right(node)); if(n_right){ @@ -66,7 +66,7 @@ class bstree_algorithms_base //! Complexity: Average constant time. //! //! Throws: Nothing. - static node_ptr prev_node(const node_ptr & node) BOOST_NOEXCEPT + static node_ptr prev_node(node_ptr node) BOOST_NOEXCEPT { if(is_header(node)){ return NodeTraits::get_right(node); @@ -126,7 +126,7 @@ class bstree_algorithms_base //! Complexity: Constant. //! //! Throws: Nothing. - static bool is_header(const const_node_ptr & p) BOOST_NOEXCEPT + 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)); @@ -150,7 +150,7 @@ class bstree_algorithms_base //! Complexity: Logarithmic. //! //! Throws: Nothing. - static node_ptr get_header(const const_node_ptr & node) + static node_ptr get_header(const_node_ptr node) { node_ptr n(detail::uncast(node)); node_ptr p(NodeTraits::get_parent(node)); diff --git a/include/boost/intrusive/detail/common_slist_algorithms.hpp b/include/boost/intrusive/detail/common_slist_algorithms.hpp index 521ba33..bc0d6b8 100644 --- a/include/boost/intrusive/detail/common_slist_algorithms.hpp +++ b/include/boost/intrusive/detail/common_slist_algorithms.hpp @@ -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)) @@ -55,13 +55,13 @@ class common_slist_algorithms 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) + BOOST_INTRUSIVE_FORCEINLINE static bool unique(const_node_ptr this_node) { 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) { return !NodeTraits::get_next(this_node); } BOOST_INTRUSIVE_FORCEINLINE static void unlink_after(node_ptr prev_node) BOOST_NOEXCEPT @@ -167,7 +167,7 @@ class common_slist_algorithms //! Complexity: Linear //! //! Throws: Nothing. - static std::size_t distance(const const_node_ptr &f, const const_node_ptr &l) BOOST_NOEXCEPT + 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; diff --git a/include/boost/intrusive/detail/default_header_holder.hpp b/include/boost/intrusive/detail/default_header_holder.hpp index ba561b5..42f35d2 100644 --- a/include/boost/intrusive/detail/default_header_holder.hpp +++ b/include/boost/intrusive/detail/default_header_holder.hpp @@ -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)); } }; diff --git a/include/boost/intrusive/detail/empty_node_checker.hpp b/include/boost/intrusive/detail/empty_node_checker.hpp index 16aa560..fbff4b6 100644 --- a/include/boost/intrusive/detail/empty_node_checker.hpp +++ b/include/boost/intrusive/detail/empty_node_checker.hpp @@ -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{ diff --git a/include/boost/intrusive/detail/hashtable_node.hpp b/include/boost/intrusive/detail/hashtable_node.hpp index b1ed68c..0b86372 100644 --- a/include/boost/intrusive/detail/hashtable_node.hpp +++ b/include/boost/intrusive/detail/hashtable_node.hpp @@ -98,7 +98,7 @@ struct bucket_traits_impl buckets_ = x.buckets_; buckets_len_ = x.buckets_len_; return *this; } - BOOST_INTRUSIVE_FORCEINLINE const bucket_ptr &bucket_begin() const + BOOST_INTRUSIVE_FORCEINLINE bucket_ptr bucket_begin() const { return buckets_; } BOOST_INTRUSIVE_FORCEINLINE size_type bucket_count() const BOOST_NOEXCEPT @@ -242,7 +242,7 @@ 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 diff --git a/include/boost/intrusive/detail/hook_traits.hpp b/include/boost/intrusive/detail/hook_traits.hpp index 7f7dc27..b716436 100644 --- a/include/boost/intrusive/detail/hook_traits.hpp +++ b/include/boost/intrusive/detail/hook_traits.hpp @@ -55,7 +55,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_to (static_cast(static_cast(*n))); @@ -63,7 +63,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::pointer_to (static_cast(static_cast(*n))); @@ -132,14 +132,14 @@ struct mhtraits (static_cast(static_cast(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_to (*detail::parent_from_member (static_cast(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::pointer_to (*detail::parent_from_member @@ -174,17 +174,17 @@ struct fhtraits static const_node_ptr to_node_ptr(const_reference value) { return static_cast(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(&*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(&*n)); } }; diff --git a/include/boost/intrusive/detail/list_iterator.hpp b/include/boost/intrusive/detail/list_iterator.hpp index 0478981..f301a4b 100644 --- a/include/boost/intrusive/detail/list_iterator.hpp +++ b/include/boost/intrusive/detail/list_iterator.hpp @@ -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,7 +81,7 @@ class list_iterator BOOST_INTRUSIVE_FORCEINLINE node_ptr pointed_node() const { return members_.nodeptr_; } - BOOST_INTRUSIVE_FORCEINLINE list_iterator &operator=(const node_ptr &nodeptr) + 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 diff --git a/include/boost/intrusive/detail/list_node.hpp b/include/boost/intrusive/detail/list_node.hpp index bc30e89..eac56f6 100644 --- a/include/boost/intrusive/detail/list_node.hpp +++ b/include/boost/intrusive/detail/list_node.hpp @@ -47,19 +47,19 @@ struct list_node_traits typedef typename node::node_ptr node_ptr; typedef typename pointer_rebind::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) diff --git a/include/boost/intrusive/detail/node_cloner_disposer.hpp b/include/boost/intrusive/detail/node_cloner_disposer.hpp index edd1270..77e3130 100644 --- a/include/boost/intrusive/detail/node_cloner_disposer.hpp +++ b/include/boost/intrusive/detail/node_cloner_disposer.hpp @@ -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)); @@ -89,7 +89,7 @@ struct node_disposer : base_t(f), traits_(cont) {} - BOOST_INTRUSIVE_FORCEINLINE void operator()(const node_ptr & p) + BOOST_INTRUSIVE_FORCEINLINE void operator()(node_ptr p) { BOOST_IF_CONSTEXPR(safemode_or_autounlink) node_algorithms::init(p); diff --git a/include/boost/intrusive/detail/node_to_value.hpp b/include/boost/intrusive/detail/node_to_value.hpp index 218e78e..3085e0c 100644 --- a/include/boost/intrusive/detail/node_to_value.hpp +++ b/include/boost/intrusive/detail/node_to_value.hpp @@ -103,7 +103,7 @@ struct node_to_value typedef typename pointer_traits:: template rebind_pointer::type const_value_traits_ptr; - node_to_value(const const_value_traits_ptr &ptr) + node_to_value(const_value_traits_ptr ptr) : Base(ptr) {} diff --git a/include/boost/intrusive/detail/rbtree_node.hpp b/include/boost/intrusive/detail/rbtree_node.hpp index 8b573ec..0781199 100644 --- a/include/boost/intrusive/detail/rbtree_node.hpp +++ b/include/boost/intrusive/detail/rbtree_node.hpp @@ -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() diff --git a/include/boost/intrusive/detail/simple_disposers.hpp b/include/boost/intrusive/detail/simple_disposers.hpp index 17fa1e4..6b9bd4b 100644 --- a/include/boost/intrusive/detail/simple_disposers.hpp +++ b/include/boost/intrusive/detail/simple_disposers.hpp @@ -41,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); } }; diff --git a/include/boost/intrusive/detail/slist_iterator.hpp b/include/boost/intrusive/detail/slist_iterator.hpp index 8be14f4..7956f63 100644 --- a/include/boost/intrusive/detail/slist_iterator.hpp +++ b/include/boost/intrusive/detail/slist_iterator.hpp @@ -65,7 +65,7 @@ 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 explicit slist_iterator(node_ptr nodeptr, const_value_traits_ptr traits_ptr) : members_(nodeptr, traits_ptr) {} @@ -83,7 +83,7 @@ class slist_iterator BOOST_INTRUSIVE_FORCEINLINE node_ptr pointed_node() const { return members_.nodeptr_; } - BOOST_INTRUSIVE_FORCEINLINE slist_iterator &operator=(const node_ptr &n) + BOOST_INTRUSIVE_FORCEINLINE slist_iterator &operator=(node_ptr n) { members_.nodeptr_ = n; return static_cast(*this); } BOOST_INTRUSIVE_FORCEINLINE const_value_traits_ptr get_value_traits() const diff --git a/include/boost/intrusive/detail/slist_node.hpp b/include/boost/intrusive/detail/slist_node.hpp index ee8ab40..d209f76 100644 --- a/include/boost/intrusive/detail/slist_node.hpp +++ b/include/boost/intrusive/detail/slist_node.hpp @@ -46,10 +46,10 @@ struct slist_node_traits typedef typename node::node_ptr node_ptr; typedef typename pointer_rebind::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) diff --git a/include/boost/intrusive/detail/tree_iterator.hpp b/include/boost/intrusive/detail/tree_iterator.hpp index 41988cf..ba1375f 100644 --- a/include/boost/intrusive/detail/tree_iterator.hpp +++ b/include/boost/intrusive/detail/tree_iterator.hpp @@ -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 diff --git a/include/boost/intrusive/detail/tree_node.hpp b/include/boost/intrusive/detail/tree_node.hpp index 6df3343..949d2d9 100644 --- a/include/boost/intrusive/detail/tree_node.hpp +++ b/include/boost/intrusive/detail/tree_node.hpp @@ -44,28 +44,28 @@ struct tree_node_traits typedef typename node::node_ptr node_ptr; typedef typename pointer_rebind::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) diff --git a/include/boost/intrusive/hashtable.hpp b/include/boost/intrusive/hashtable.hpp index 68098e8..5baeaac 100644 --- a/include/boost/intrusive/hashtable.hpp +++ b/include/boost/intrusive/hashtable.hpp @@ -426,7 +426,7 @@ struct group_functions } } - BOOST_INTRUSIVE_FORCEINLINE static void erase_from_group(const slist_node_ptr&, const node_ptr&, detail::false_) + BOOST_INTRUSIVE_FORCEINLINE static void erase_from_group(slist_node_ptr, node_ptr, detail::false_) {} BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_last_in_group(node_ptr first_in_group, detail::true_) @@ -455,7 +455,7 @@ struct group_functions BOOST_INTRUSIVE_FORCEINLINE static void insert_in_group(node_ptr first_in_group, node_ptr n, true_) { group_algorithms::link_after(first_in_group, n); } - static void insert_in_group(const node_ptr&, const node_ptr&, false_) + static void insert_in_group(node_ptr, node_ptr, false_) {} BOOST_INTRUSIVE_FORCEINLINE static node_ptr split_group(node_ptr const new_first_in_group) @@ -620,7 +620,7 @@ struct downcast_node_to_value_t template rebind_pointer ::type const_value_traits_ptr; - BOOST_INTRUSIVE_FORCEINLINE downcast_node_to_value_t(const const_value_traits_ptr &ptr) + BOOST_INTRUSIVE_FORCEINLINE downcast_node_to_value_t(const_value_traits_ptr ptr) : base_t(ptr) {} @@ -1159,7 +1159,7 @@ struct bucket_hash_equal_t BOOST_INTRUSIVE_FORCEINLINE bucket_ptr priv_get_cache() { return this->bucket_hash_type::priv_bucket_pointer(); } - BOOST_INTRUSIVE_FORCEINLINE void priv_set_cache(const bucket_ptr &) + BOOST_INTRUSIVE_FORCEINLINE void priv_set_cache(bucket_ptr) {} BOOST_INTRUSIVE_FORCEINLINE std::size_t priv_get_cache_bucket_num() @@ -1229,13 +1229,10 @@ struct bucket_hash_equal_t::type bucket_ptr; - BOOST_INTRUSIVE_FORCEINLINE bucket_ptr &priv_get_cache() + BOOST_INTRUSIVE_FORCEINLINE bucket_ptr priv_get_cache() const { return cached_begin_; } - BOOST_INTRUSIVE_FORCEINLINE const bucket_ptr &priv_get_cache() const - { return cached_begin_; } - - BOOST_INTRUSIVE_FORCEINLINE void priv_set_cache(const bucket_ptr &p) + BOOST_INTRUSIVE_FORCEINLINE void priv_set_cache(bucket_ptr p) { cached_begin_ = p; } BOOST_INTRUSIVE_FORCEINLINE std::size_t priv_get_cache_bucket_num() @@ -1291,8 +1288,8 @@ struct bucket_hash_equal_tpriv_get_cache() - this->bucket_hash_type::priv_bucket_pointer()); for( const std::size_t num_buckets = this->bucket_hash_type::priv_bucket_count() ; current_n < num_buckets - ; ++current_n, ++this->priv_get_cache()){ - if(!this->priv_get_cache()->empty()){ + ; ++current_n, ++cached_begin_){ + if(!cached_begin_->empty()){ return; } } diff --git a/include/boost/intrusive/linear_slist_algorithms.hpp b/include/boost/intrusive/linear_slist_algorithms.hpp index 2ed6cbe..a9030f7 100644 --- a/include/boost/intrusive/linear_slist_algorithms.hpp +++ b/include/boost/intrusive/linear_slist_algorithms.hpp @@ -78,7 +78,7 @@ class linear_slist_algorithms //! Complexity: Constant //! //! Throws: Nothing. - static void init(const node_ptr & this_node) BOOST_NOEXCEPT; + static void init(node_ptr this_node) BOOST_NOEXCEPT; //! Requires: this_node must be in a circular list or be an empty circular list. //! @@ -106,7 +106,7 @@ class linear_slist_algorithms //! Complexity: Constant //! //! Throws: Nothing. - static void unlink_after(const node_ptr & prev_node) BOOST_NOEXCEPT; + static void unlink_after(node_ptr prev_node) BOOST_NOEXCEPT; //! Requires: prev_node and last_node must be in a circular list //! or be an empty circular list. @@ -116,7 +116,7 @@ class linear_slist_algorithms //! Complexity: Constant //! //! Throws: Nothing. - static void unlink_after(const node_ptr & prev_node, const node_ptr & last_node) BOOST_NOEXCEPT; + static void unlink_after(node_ptr prev_node, node_ptr last_node) BOOST_NOEXCEPT; //! Requires: prev_node must be a node of a linear list. //! @@ -125,7 +125,7 @@ class linear_slist_algorithms //! Complexity: Constant //! //! Throws: Nothing. - static void link_after(const node_ptr & prev_node, const node_ptr & this_node) BOOST_NOEXCEPT; + static void link_after(node_ptr prev_node, node_ptr this_node) BOOST_NOEXCEPT; //! Requires: b and e must be nodes of the same linear list or an empty range. //! and p must be a node of a different linear list. @@ -136,7 +136,7 @@ class linear_slist_algorithms //! Complexity: Constant //! //! Throws: Nothing. - static void transfer_after(const node_ptr & p, const node_ptr & b, const node_ptr & e) BOOST_NOEXCEPT; + static void transfer_after(node_ptr p, node_ptr b, node_ptr e) BOOST_NOEXCEPT; #endif //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) @@ -147,7 +147,7 @@ class linear_slist_algorithms //! Complexity: Constant //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static void init_header(const node_ptr & this_node) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static void init_header(node_ptr this_node) BOOST_NOEXCEPT { NodeTraits::set_next(this_node, node_ptr ()); } //! Requires: this_node and prev_init_node must be in the same linear list. @@ -160,7 +160,7 @@ class linear_slist_algorithms //! //! Throws: Nothing. BOOST_INTRUSIVE_FORCEINLINE static node_ptr - get_previous_node(const node_ptr & prev_init_node, const node_ptr & this_node) BOOST_NOEXCEPT + get_previous_node(node_ptr prev_init_node, node_ptr this_node) BOOST_NOEXCEPT { return base_t::get_previous_node(prev_init_node, this_node); } //! Requires: this_node must be in a linear list or be an empty linear list. @@ -171,7 +171,7 @@ class linear_slist_algorithms //! Complexity: Linear //! //! Throws: Nothing. - static std::size_t count(const const_node_ptr & this_node) BOOST_NOEXCEPT + static std::size_t count(const_node_ptr this_node) BOOST_NOEXCEPT { std::size_t result = 0; const_node_ptr p = this_node; diff --git a/include/boost/intrusive/list.hpp b/include/boost/intrusive/list.hpp index fbc4520..01d7381 100644 --- a/include/boost/intrusive/list.hpp +++ b/include/boost/intrusive/list.hpp @@ -638,7 +638,8 @@ class list_impl iterator erase(const_iterator b, const_iterator e, size_type n) BOOST_NOEXCEPT { BOOST_INTRUSIVE_INVARIANT_ASSERT(node_algorithms::distance(b.pointed_node(), e.pointed_node()) == n); - BOOST_IF_CONSTEXPR(safemode_or_autounlink || constant_time_size){ + (void)n; + BOOST_IF_CONSTEXPR(safemode_or_autounlink){ return this->erase_and_dispose(b, e, detail::null_disposer()); } else{ diff --git a/include/boost/intrusive/member_value_traits.hpp b/include/boost/intrusive/member_value_traits.hpp index b20b6b8..f673b64 100644 --- a/include/boost/intrusive/member_value_traits.hpp +++ b/include/boost/intrusive/member_value_traits.hpp @@ -63,13 +63,13 @@ struct member_value_traits BOOST_INTRUSIVE_FORCEINLINE static const_node_ptr to_node_ptr(const_reference value) BOOST_NOEXCEPT { return pointer_traits::pointer_to(value.*PtrToMember); } - BOOST_INTRUSIVE_FORCEINLINE static pointer to_value_ptr(const node_ptr &n) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static pointer to_value_ptr(node_ptr n) BOOST_NOEXCEPT { return pointer_traits::pointer_to(*detail::parent_from_member (boost::movelib::to_raw_pointer(n), PtrToMember)); } - BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const const_node_ptr &n) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const_node_ptr n) BOOST_NOEXCEPT { return pointer_traits::pointer_to(*detail::parent_from_member (boost::movelib::to_raw_pointer(n), PtrToMember)); diff --git a/include/boost/intrusive/rbtree_algorithms.hpp b/include/boost/intrusive/rbtree_algorithms.hpp index bdb0410..f8aba45 100644 --- a/include/boost/intrusive/rbtree_algorithms.hpp +++ b/include/boost/intrusive/rbtree_algorithms.hpp @@ -85,7 +85,7 @@ struct rbtree_node_checker : base_checker_t(comp, extra_checker) {} - void operator () (const const_node_ptr& p, + void operator () (const_node_ptr p, const return_type& check_return_left, const return_type& check_return_right, return_type& check_return) { @@ -190,14 +190,14 @@ class rbtree_algorithms #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED - //! @copydoc ::boost::intrusive::bstree_algorithms::get_header(const const_node_ptr&) - static node_ptr get_header(const const_node_ptr & n) BOOST_NOEXCEPT; + //! @copydoc ::boost::intrusive::bstree_algorithms::get_header(const_node_ptr) + static node_ptr get_header(const_node_ptr n) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::begin_node - static node_ptr begin_node(const const_node_ptr & header) BOOST_NOEXCEPT; + static node_ptr begin_node(const_node_ptr header) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::end_node - static node_ptr end_node(const const_node_ptr & header) BOOST_NOEXCEPT; + static node_ptr end_node(const_node_ptr header) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::swap_tree static void swap_tree(node_ptr header1, node_ptr header2) BOOST_NOEXCEPT; @@ -242,7 +242,7 @@ class rbtree_algorithms } //! @copydoc ::boost::intrusive::bstree_algorithms::unlink(node_ptr) - static void unlink(const node_ptr& node) BOOST_NOEXCEPT + static void unlink(node_ptr node) BOOST_NOEXCEPT { node_ptr x = NodeTraits::get_parent(node); if(x){ @@ -254,22 +254,22 @@ class rbtree_algorithms #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree_algorithms::unlink_leftmost_without_rebalance - static node_ptr unlink_leftmost_without_rebalance(const node_ptr & header) BOOST_NOEXCEPT; + static node_ptr unlink_leftmost_without_rebalance(node_ptr header) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::unique(const const_node_ptr&) - static bool unique(const const_node_ptr & node) BOOST_NOEXCEPT; + //! @copydoc ::boost::intrusive::bstree_algorithms::unique(const_node_ptr) + static bool unique(const_node_ptr node) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::size(const const_node_ptr&) - static std::size_t size(const const_node_ptr & header) BOOST_NOEXCEPT; + //! @copydoc ::boost::intrusive::bstree_algorithms::size(const_node_ptr) + static std::size_t size(const_node_ptr header) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::next_node(const node_ptr&) - static node_ptr next_node(const node_ptr & node) BOOST_NOEXCEPT; + //! @copydoc ::boost::intrusive::bstree_algorithms::next_node(const_node_ptr) + static node_ptr next_node(node_ptr node) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::prev_node(const node_ptr&) - static node_ptr prev_node(const node_ptr & node) BOOST_NOEXCEPT; + //! @copydoc ::boost::intrusive::bstree_algorithms::prev_node(const_node_ptr) + static node_ptr prev_node(node_ptr node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::init(node_ptr) - static void init(const node_ptr & node) BOOST_NOEXCEPT; + static void init(node_ptr node) BOOST_NOEXCEPT; #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree_algorithms::init_header(node_ptr) @@ -313,7 +313,7 @@ class rbtree_algorithms rebalance_after_insertion(header1, z); } - //! @copydoc ::boost::intrusive::bstree_algorithms::clone(const const_node_ptr&,node_ptr,Cloner,Disposer) + //! @copydoc ::boost::intrusive::bstree_algorithms::clone(const_node_ptr,node_ptr,Cloner,Disposer) template static void clone (const_node_ptr source_header, node_ptr target_header, Cloner cloner, Disposer disposer) @@ -323,39 +323,39 @@ class rbtree_algorithms } #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED - //! @copydoc ::boost::intrusive::bstree_algorithms::clear_and_dispose(const node_ptr&,Disposer) + //! @copydoc ::boost::intrusive::bstree_algorithms::clear_and_dispose(const_node_ptr,Disposer) template - static void clear_and_dispose(const node_ptr & header, Disposer disposer) BOOST_NOEXCEPT; + static void clear_and_dispose(node_ptr header, Disposer disposer) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound(const_node_ptr,const KeyType&,KeyNodePtrCompare) template static node_ptr lower_bound - (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp); + (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); - //! @copydoc ::boost::intrusive::bstree_algorithms::upper_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::upper_bound(const_node_ptr,const KeyType&,KeyNodePtrCompare) template static node_ptr upper_bound - (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp); + (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); - //! @copydoc ::boost::intrusive::bstree_algorithms::find(const const_node_ptr&, const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::find(const_node_ptr, const KeyType&,KeyNodePtrCompare) template static node_ptr find - (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp); + (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); - //! @copydoc ::boost::intrusive::bstree_algorithms::equal_range(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::equal_range(const_node_ptr,const KeyType&,KeyNodePtrCompare) template static std::pair equal_range - (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp); + (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); - //! @copydoc ::boost::intrusive::bstree_algorithms::bounded_range(const const_node_ptr&,const KeyType&,const KeyType&,KeyNodePtrCompare,bool,bool) + //! @copydoc ::boost::intrusive::bstree_algorithms::bounded_range(const_node_ptr,const KeyType&,const KeyType&,KeyNodePtrCompare,bool,bool) template static std::pair bounded_range - (const const_node_ptr & header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp + (const_node_ptr eader, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp , bool left_closed, bool right_closed); - //! @copydoc ::boost::intrusive::bstree_algorithms::count(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::count(const_node_ptr,const KeyType&,KeyNodePtrCompare) template - static std::size_t count(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp); + static std::size_t count(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED @@ -413,13 +413,13 @@ class rbtree_algorithms } #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED - //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const const_node_ptr&,const KeyType&,KeyNodePtrCompare,insert_commit_data&) + //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const_node_ptr,const KeyType&,KeyNodePtrCompare,insert_commit_data&) template static std::pair insert_unique_check (const_node_ptr header, const KeyType &key ,KeyNodePtrCompare comp, insert_commit_data &commit_data); - //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const const_node_ptr&,const node_ptr&,const KeyType&,KeyNodePtrCompare,insert_commit_data&) + //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const_node_ptr,const_node_ptr,const KeyType&,KeyNodePtrCompare,insert_commit_data&) template static std::pair insert_unique_check (const_node_ptr header, node_ptr hint, const KeyType &key @@ -435,7 +435,7 @@ class rbtree_algorithms } //! @copydoc ::boost::intrusive::bstree_algorithms::is_header - static bool is_header(const const_node_ptr & p) BOOST_NOEXCEPT + static bool is_header(const_node_ptr p) BOOST_NOEXCEPT { return NodeTraits::get_color(p) == NodeTraits::red() && bstree_algo::is_header(p); diff --git a/include/boost/intrusive/sgtree_algorithms.hpp b/include/boost/intrusive/sgtree_algorithms.hpp index e880cc8..27add03 100644 --- a/include/boost/intrusive/sgtree_algorithms.hpp +++ b/include/boost/intrusive/sgtree_algorithms.hpp @@ -85,7 +85,7 @@ class sgtree_algorithms }; #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED - //! @copydoc ::boost::intrusive::bstree_algorithms::get_header(const const_node_ptr&) + //! @copydoc ::boost::intrusive::bstree_algorithms::get_header(const_node_ptr) static node_ptr get_header(const_node_ptr n) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::begin_node @@ -115,16 +115,16 @@ class sgtree_algorithms //! @copydoc ::boost::intrusive::bstree_algorithms::unlink_leftmost_without_rebalance static node_ptr unlink_leftmost_without_rebalance(node_ptr header) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::unique(const const_node_ptr&) + //! @copydoc ::boost::intrusive::bstree_algorithms::unique(const_node_ptr) static bool unique(const_node_ptr node) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::size(const const_node_ptr&) + //! @copydoc ::boost::intrusive::bstree_algorithms::size(const_node_ptr) static std::size_t size(const_node_ptr header) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::next_node(const node_ptr&) + //! @copydoc ::boost::intrusive::bstree_algorithms::next_node(node_ptr) static node_ptr next_node(node_ptr node) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::prev_node(const node_ptr&) + //! @copydoc ::boost::intrusive::bstree_algorithms::prev_node(node_ptr) static node_ptr prev_node(node_ptr node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::init(node_ptr) @@ -149,42 +149,42 @@ class sgtree_algorithms } #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED - //! @copydoc ::boost::intrusive::bstree_algorithms::clone(const const_node_ptr&,node_ptr,Cloner,Disposer) + //! @copydoc ::boost::intrusive::bstree_algorithms::clone(const_node_ptr,node_ptr,Cloner,Disposer) template static void clone (const_node_ptr source_header, node_ptr target_header, Cloner cloner, Disposer disposer); - //! @copydoc ::boost::intrusive::bstree_algorithms::clear_and_dispose(const node_ptr&,Disposer) + //! @copydoc ::boost::intrusive::bstree_algorithms::clear_and_dispose(node_ptr,Disposer) template static void clear_and_dispose(node_ptr header, Disposer disposer) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound(const_node_ptr,const KeyType&,KeyNodePtrCompare) template static node_ptr lower_bound (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); - //! @copydoc ::boost::intrusive::bstree_algorithms::upper_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::upper_bound(const_node_ptr,const KeyType&,KeyNodePtrCompare) template static node_ptr upper_bound (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); - //! @copydoc ::boost::intrusive::bstree_algorithms::find(const const_node_ptr&, const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::find(const_node_ptr, const KeyType&,KeyNodePtrCompare) template static node_ptr find (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); - //! @copydoc ::boost::intrusive::bstree_algorithms::equal_range(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::equal_range(const_node_ptr,const KeyType&,KeyNodePtrCompare) template static std::pair equal_range (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); - //! @copydoc ::boost::intrusive::bstree_algorithms::bounded_range(const const_node_ptr&,const KeyType&,const KeyType&,KeyNodePtrCompare,bool,bool) + //! @copydoc ::boost::intrusive::bstree_algorithms::bounded_range(const_node_ptr,const KeyType&,const KeyType&,KeyNodePtrCompare,bool,bool) template static std::pair bounded_range (const_node_ptr header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp , bool left_closed, bool right_closed); - //! @copydoc ::boost::intrusive::bstree_algorithms::count(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::count(const_node_ptr,const KeyType&,KeyNodePtrCompare) template static std::size_t count(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); @@ -258,7 +258,7 @@ class sgtree_algorithms rebalance_after_insertion(new_node, depth, tree_size+1, h_alpha, max_tree_size); } - //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const const_node_ptr&,const KeyType&,KeyNodePtrCompare,insert_commit_data&) + //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const_node_ptr,const KeyType&,KeyNodePtrCompare,insert_commit_data&) template static std::pair insert_unique_check (const_node_ptr header, const KeyType &key @@ -271,7 +271,7 @@ class sgtree_algorithms return ret; } - //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const const_node_ptr&,const node_ptr&,const KeyType&,KeyNodePtrCompare,insert_commit_data&) + //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const_node_ptr,node_ptr,const KeyType&,KeyNodePtrCompare,insert_commit_data&) template static std::pair insert_unique_check (const_node_ptr header, node_ptr hint, const KeyType &key diff --git a/include/boost/intrusive/slist.hpp b/include/boost/intrusive/slist.hpp index 4f0871d..8ef2e23 100644 --- a/include/boost/intrusive/slist.hpp +++ b/include/boost/intrusive/slist.hpp @@ -191,7 +191,7 @@ class slist_impl const_node_ptr get_last_node() const { return this->get_last_node(detail::bool_()); } - void set_last_node(const node_ptr &n) + void set_last_node(node_ptr n) { return this->set_last_node(n, detail::bool_()); } static node_ptr get_last_node(detail::bool_) @@ -201,7 +201,7 @@ class slist_impl return node_ptr(); } - static void set_last_node(const node_ptr &, detail::bool_) + static void set_last_node(node_ptr , detail::bool_) { //This function shall not be used if cache_last is not true BOOST_INTRUSIVE_INVARIANT_ASSERT(cache_last); @@ -213,7 +213,7 @@ class slist_impl const_node_ptr get_last_node(detail::bool_) const { return const_node_ptr(data_.root_plus_size_.last_); } - void set_last_node(const node_ptr & n, detail::bool_) + void set_last_node(node_ptr n, detail::bool_) { data_.root_plus_size_.last_ = n; } void set_default_constructed_state() @@ -281,7 +281,7 @@ class slist_impl //! list. Iterators of this list and all the references are not invalidated. //! //! Warning: Experimental function, don't use it! - slist_impl( const node_ptr & f, const node_ptr & before_l + slist_impl( node_ptr f, node_ptr before_l , size_type n, const value_traits &v_traits = value_traits()) : data_(v_traits) { @@ -960,6 +960,7 @@ class slist_impl iterator erase_after(const_iterator before_f, const_iterator l, size_type n) BOOST_NOEXCEPT { BOOST_INTRUSIVE_INVARIANT_ASSERT(node_algorithms::distance((++const_iterator(before_f)).pointed_node(), l.pointed_node()) == n); + (void)n; BOOST_IF_CONSTEXPR(safemode_or_autounlink){ return this->erase_after(before_f, l); } @@ -1342,6 +1343,7 @@ class slist_impl void splice_after(const_iterator prev_pos, slist_impl &x, const_iterator before_f, const_iterator before_l, size_type n) BOOST_NOEXCEPT { BOOST_INTRUSIVE_INVARIANT_ASSERT(node_algorithms::distance(before_f.pointed_node(), before_l.pointed_node()) == n); + (void)n; this->priv_splice_after (prev_pos.pointed_node(), x, before_f.pointed_node(), before_l.pointed_node()); BOOST_IF_CONSTEXPR(constant_time_size){ @@ -1881,7 +1883,7 @@ class slist_impl //! point to elements of this list. Iterators of this list and all the references are not invalidated. //! //! Warning: Experimental function, don't use it! - void incorporate_after(const_iterator prev_pos, const node_ptr & f, const node_ptr & before_l) BOOST_NOEXCEPT + void incorporate_after(const_iterator prev_pos, node_ptr f, node_ptr before_l) BOOST_NOEXCEPT { BOOST_IF_CONSTEXPR(constant_time_size) this->incorporate_after(prev_pos, f, before_l, node_algorithms::distance(f.pointed_node(), before_l.pointed_node())+1); @@ -1905,7 +1907,7 @@ class slist_impl //! point to elements of this list. Iterators of this list and all the references are not invalidated. //! //! Warning: Experimental function, don't use it! - void incorporate_after(const_iterator prev_pos, const node_ptr & f, const node_ptr & before_l, size_type n) BOOST_NOEXCEPT + void incorporate_after(const_iterator prev_pos, node_ptr f, node_ptr before_l, size_type n) BOOST_NOEXCEPT { if(n){ BOOST_INTRUSIVE_INVARIANT_ASSERT(n > 0); @@ -2208,7 +2210,7 @@ class slist struct incorporate_t{}; - BOOST_INTRUSIVE_FORCEINLINE slist( const node_ptr & f, const node_ptr & before_l + BOOST_INTRUSIVE_FORCEINLINE slist( node_ptr f, node_ptr before_l , size_type n, const value_traits &v_traits = value_traits()) : Base(f, before_l, n, v_traits) {} diff --git a/include/boost/intrusive/splaytree_algorithms.hpp b/include/boost/intrusive/splaytree_algorithms.hpp index ce921bb..b36fddd 100644 --- a/include/boost/intrusive/splaytree_algorithms.hpp +++ b/include/boost/intrusive/splaytree_algorithms.hpp @@ -175,17 +175,17 @@ class splaytree_algorithms public: #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED - //! @copydoc ::boost::intrusive::bstree_algorithms::get_header(const const_node_ptr&) - static node_ptr get_header(const const_node_ptr & n) BOOST_NOEXCEPT; + //! @copydoc ::boost::intrusive::bstree_algorithms::get_header(const_node_ptr) + static node_ptr get_header(const_node_ptr n) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::begin_node - static node_ptr begin_node(const const_node_ptr & header) BOOST_NOEXCEPT; + static node_ptr begin_node(const_node_ptr header) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::end_node - static node_ptr end_node(const const_node_ptr & header) BOOST_NOEXCEPT; + static node_ptr end_node(const_node_ptr header) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::swap_tree - static void swap_tree(const node_ptr & header1, const node_ptr & header2); + static void swap_tree(node_ptr header1, node_ptr header2); //! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr) static void swap_nodes(node_ptr node1, node_ptr node2) BOOST_NOEXCEPT; @@ -205,16 +205,16 @@ class splaytree_algorithms //! @copydoc ::boost::intrusive::bstree_algorithms::unlink_leftmost_without_rebalance static node_ptr unlink_leftmost_without_rebalance(node_ptr header) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::unique(const const_node_ptr&) + //! @copydoc ::boost::intrusive::bstree_algorithms::unique(const_node_ptr) static bool unique(const_node_ptr node) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::size(const const_node_ptr&) + //! @copydoc ::boost::intrusive::bstree_algorithms::size(const_node_ptr) static std::size_t size(const_node_ptr header) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::next_node(const node_ptr&) + //! @copydoc ::boost::intrusive::bstree_algorithms::next_node(node_ptr) static node_ptr next_node(node_ptr node) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::prev_node(const node_ptr&) + //! @copydoc ::boost::intrusive::bstree_algorithms::prev_node(node_ptr) static node_ptr prev_node(node_ptr node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::init(node_ptr) @@ -279,17 +279,17 @@ class splaytree_algorithms } #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED - //! @copydoc ::boost::intrusive::bstree_algorithms::clone(const const_node_ptr&,node_ptr,Cloner,Disposer) + //! @copydoc ::boost::intrusive::bstree_algorithms::clone(const_node_ptr,node_ptr,Cloner,Disposer) template static void clone (const_node_ptr source_header, node_ptr target_header, Cloner cloner, Disposer disposer); - //! @copydoc ::boost::intrusive::bstree_algorithms::clear_and_dispose(const node_ptr&,Disposer) + //! @copydoc ::boost::intrusive::bstree_algorithms::clear_and_dispose(node_ptr,Disposer) template static void clear_and_dispose(node_ptr header, Disposer disposer) BOOST_NOEXCEPT; #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED - //! @copydoc ::boost::intrusive::bstree_algorithms::count(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::count(const_node_ptr,const KeyType&,KeyNodePtrCompare) //! Additional notes: an element with key `key` is splayed. template static std::size_t count @@ -304,14 +304,14 @@ class splaytree_algorithms return n; } - //! @copydoc ::boost::intrusive::bstree_algorithms::count(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::count(const_node_ptr,const KeyType&,KeyNodePtrCompare) //! Additional note: no splaying is performed template static std::size_t count (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp) { return bstree_algo::count(header, key, comp); } - //! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound(const_node_ptr,const KeyType&,KeyNodePtrCompare) //! Additional notes: the first node of the range is splayed. template static node_ptr lower_bound @@ -323,14 +323,14 @@ class splaytree_algorithms return y; } - //! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound(const_node_ptr,const KeyType&,KeyNodePtrCompare) //! Additional note: no splaying is performed template static node_ptr lower_bound (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp) { return bstree_algo::lower_bound(header, key, comp); } - //! @copydoc ::boost::intrusive::bstree_algorithms::upper_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::upper_bound(const_node_ptr,const KeyType&,KeyNodePtrCompare) //! Additional notes: the first node of the range is splayed. template static node_ptr upper_bound @@ -342,14 +342,14 @@ class splaytree_algorithms return y; } - //! @copydoc ::boost::intrusive::bstree_algorithms::upper_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::upper_bound(const_node_ptr,const KeyType&,KeyNodePtrCompare) //! Additional note: no splaying is performed template static node_ptr upper_bound (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp) { return bstree_algo::upper_bound(header, key, comp); } - //! @copydoc ::boost::intrusive::bstree_algorithms::find(const const_node_ptr&, const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::find(const_node_ptr, const KeyType&,KeyNodePtrCompare) //! Additional notes: the found node of the lower bound is splayed. template static node_ptr find @@ -359,14 +359,14 @@ class splaytree_algorithms return bstree_algo::find(header, key, comp); } - //! @copydoc ::boost::intrusive::bstree_algorithms::find(const const_node_ptr&, const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::find(const_node_ptr, const KeyType&,KeyNodePtrCompare) //! Additional note: no splaying is performed template static node_ptr find (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp) { return bstree_algo::find(header, key, comp); } - //! @copydoc ::boost::intrusive::bstree_algorithms::equal_range(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::equal_range(const_node_ptr,const KeyType&,KeyNodePtrCompare) //! Additional notes: the first node of the range is splayed. template static std::pair equal_range @@ -378,14 +378,14 @@ class splaytree_algorithms return ret; } - //! @copydoc ::boost::intrusive::bstree_algorithms::equal_range(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::equal_range(const_node_ptr,const KeyType&,KeyNodePtrCompare) //! Additional note: no splaying is performed template static std::pair equal_range (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp) { return bstree_algo::equal_range(header, key, comp); } - //! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound_range(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound_range(const_node_ptr,const KeyType&,KeyNodePtrCompare) //! Additional notes: the first node of the range is splayed. template static std::pair lower_bound_range @@ -397,14 +397,14 @@ class splaytree_algorithms return ret; } - //! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound_range(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound_range(const_node_ptr,const KeyType&,KeyNodePtrCompare) //! Additional note: no splaying is performed template static std::pair lower_bound_range (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp) { return bstree_algo::lower_bound_range(header, key, comp); } - //! @copydoc ::boost::intrusive::bstree_algorithms::bounded_range(const const_node_ptr&,const KeyType&,const KeyType&,KeyNodePtrCompare,bool,bool) + //! @copydoc ::boost::intrusive::bstree_algorithms::bounded_range(const_node_ptr,const KeyType&,const KeyType&,KeyNodePtrCompare,bool,bool) //! Additional notes: the first node of the range is splayed. template static std::pair bounded_range @@ -418,7 +418,7 @@ class splaytree_algorithms return ret; } - //! @copydoc ::boost::intrusive::bstree_algorithms::bounded_range(const const_node_ptr&,const KeyType&,const KeyType&,KeyNodePtrCompare,bool,bool) + //! @copydoc ::boost::intrusive::bstree_algorithms::bounded_range(const_node_ptr,const KeyType&,const KeyType&,KeyNodePtrCompare,bool,bool) //! Additional note: no splaying is performed template static std::pair bounded_range @@ -482,7 +482,7 @@ class splaytree_algorithms splay_up(new_node, header); } - //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const const_node_ptr&,const KeyType&,KeyNodePtrCompare,insert_commit_data&) + //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const_node_ptr,const KeyType&,KeyNodePtrCompare,insert_commit_data&) //! Additional note: nodes with the given key are splayed template static std::pair insert_unique_check @@ -493,7 +493,7 @@ class splaytree_algorithms return bstree_algo::insert_unique_check(header, key, comp, commit_data); } - //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const const_node_ptr&,const node_ptr&,const KeyType&,KeyNodePtrCompare,insert_commit_data&) + //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const_node_ptr,node_ptr,const KeyType&,KeyNodePtrCompare,insert_commit_data&) //! Additional note: nodes with the given key are splayed template static std::pair insert_unique_check diff --git a/include/boost/intrusive/treap_algorithms.hpp b/include/boost/intrusive/treap_algorithms.hpp index 978bc7c..f2150c1 100644 --- a/include/boost/intrusive/treap_algorithms.hpp +++ b/include/boost/intrusive/treap_algorithms.hpp @@ -49,7 +49,7 @@ struct treap_node_extra_checker : base_checker_t(extra_checker), prio_comp_(prio_comp) {} - void operator () (const const_node_ptr& p, + void operator () (const_node_ptr p, const return_type& check_return_left, const return_type& check_return_right, return_type& check_return) { @@ -178,7 +178,7 @@ class treap_algorithms #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED - //! @copydoc ::boost::intrusive::bstree_algorithms::get_header(const const_node_ptr&) + //! @copydoc ::boost::intrusive::bstree_algorithms::get_header(const_node_ptr) static node_ptr get_header(const_node_ptr n) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::begin_node @@ -219,16 +219,16 @@ class treap_algorithms //! @copydoc ::boost::intrusive::bstree_algorithms::unlink_leftmost_without_rebalance static node_ptr unlink_leftmost_without_rebalance(node_ptr header) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::unique(const const_node_ptr&) + //! @copydoc ::boost::intrusive::bstree_algorithms::unique(const_node_ptr) static bool unique(const_node_ptr node) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::size(const const_node_ptr&) + //! @copydoc ::boost::intrusive::bstree_algorithms::size(const_node_ptr) static std::size_t size(const_node_ptr header) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::next_node(const node_ptr&) + //! @copydoc ::boost::intrusive::bstree_algorithms::next_node(node_ptr) static node_ptr next_node(node_ptr node) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::prev_node(const node_ptr&) + //! @copydoc ::boost::intrusive::bstree_algorithms::prev_node(node_ptr) static node_ptr prev_node(node_ptr node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::init(node_ptr) @@ -248,42 +248,42 @@ class treap_algorithms } #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED - //! @copydoc ::boost::intrusive::bstree_algorithms::clone(const const_node_ptr&,node_ptr,Cloner,Disposer) + //! @copydoc ::boost::intrusive::bstree_algorithms::clone(const_node_ptr,node_ptr,Cloner,Disposer) template static void clone (const_node_ptr source_header, node_ptr target_header, Cloner cloner, Disposer disposer); - //! @copydoc ::boost::intrusive::bstree_algorithms::clear_and_dispose(const node_ptr&,Disposer) + //! @copydoc ::boost::intrusive::bstree_algorithms::clear_and_dispose(node_ptr,Disposer) template static void clear_and_dispose(node_ptr header, Disposer disposer) BOOST_NOEXCEPT; - //! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound(const_node_ptr,const KeyType&,KeyNodePtrCompare) template static node_ptr lower_bound (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); - //! @copydoc ::boost::intrusive::bstree_algorithms::upper_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::upper_bound(const_node_ptr,const KeyType&,KeyNodePtrCompare) template static node_ptr upper_bound (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); - //! @copydoc ::boost::intrusive::bstree_algorithms::find(const const_node_ptr&, const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::find(const_node_ptr, const KeyType&,KeyNodePtrCompare) template static node_ptr find (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); - //! @copydoc ::boost::intrusive::bstree_algorithms::equal_range(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::equal_range(const_node_ptr,const KeyType&,KeyNodePtrCompare) template static std::pair equal_range (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); - //! @copydoc ::boost::intrusive::bstree_algorithms::bounded_range(const const_node_ptr&,const KeyType&,const KeyType&,KeyNodePtrCompare,bool,bool) + //! @copydoc ::boost::intrusive::bstree_algorithms::bounded_range(const_node_ptr,const KeyType&,const KeyType&,KeyNodePtrCompare,bool,bool) template static std::pair bounded_range (const_node_ptr header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp , bool left_closed, bool right_closed); - //! @copydoc ::boost::intrusive::bstree_algorithms::count(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) + //! @copydoc ::boost::intrusive::bstree_algorithms::count(const_node_ptr,const KeyType&,KeyNodePtrCompare) template static std::size_t count(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp); diff --git a/include/boost/intrusive/trivial_value_traits.hpp b/include/boost/intrusive/trivial_value_traits.hpp index 7a28d4c..3968fa6 100644 --- a/include/boost/intrusive/trivial_value_traits.hpp +++ b/include/boost/intrusive/trivial_value_traits.hpp @@ -47,9 +47,9 @@ struct trivial_value_traits { return pointer_traits::pointer_to(value); } BOOST_INTRUSIVE_FORCEINLINE static const_node_ptr to_node_ptr (const value_type &value) BOOST_NOEXCEPT { return pointer_traits::pointer_to(value); } - BOOST_INTRUSIVE_FORCEINLINE static const pointer & to_value_ptr(const node_ptr &n) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static pointer to_value_ptr(node_ptr n) BOOST_NOEXCEPT { return n; } - BOOST_INTRUSIVE_FORCEINLINE static const const_pointer &to_value_ptr(const const_node_ptr &n) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const_node_ptr n) BOOST_NOEXCEPT { return n; } }; diff --git a/include/boost/intrusive/unordered_set_hook.hpp b/include/boost/intrusive/unordered_set_hook.hpp index 2fc35ec..08b0702 100644 --- a/include/boost/intrusive/unordered_set_hook.hpp +++ b/include/boost/intrusive/unordered_set_hook.hpp @@ -82,22 +82,22 @@ struct unordered_node_traits static const bool store_hash = StoreHash; static const bool optimize_multikey = OptimizeMultiKey; - BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const const_node_ptr & n) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const_node_ptr n) BOOST_NOEXCEPT { return pointer_traits::static_cast_from(n->next_); } BOOST_INTRUSIVE_FORCEINLINE static void set_next(node_ptr n, node_ptr next) BOOST_NOEXCEPT { n->next_ = next; } - BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_prev_in_group(const const_node_ptr & n) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_prev_in_group(const_node_ptr n) BOOST_NOEXCEPT { return n->prev_in_group_; } BOOST_INTRUSIVE_FORCEINLINE static void set_prev_in_group(node_ptr n, node_ptr prev) BOOST_NOEXCEPT { n->prev_in_group_ = prev; } - BOOST_INTRUSIVE_FORCEINLINE static std::size_t get_hash(const const_node_ptr & n) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static std::size_t get_hash(const_node_ptr n) BOOST_NOEXCEPT { return n->hash_; } - BOOST_INTRUSIVE_FORCEINLINE static void set_hash(const node_ptr & n, std::size_t h) BOOST_NOEXCEPT + BOOST_INTRUSIVE_FORCEINLINE static void set_hash(node_ptr n, std::size_t h) BOOST_NOEXCEPT { n->hash_ = h; } }; @@ -108,7 +108,7 @@ struct unordered_group_adapter typedef typename NodeTraits::node_ptr node_ptr; typedef typename NodeTraits::const_node_ptr const_node_ptr; - static node_ptr get_next(const const_node_ptr & n) + static node_ptr get_next(const_node_ptr n) { return NodeTraits::get_prev_in_group(n); } static void set_next(node_ptr n, node_ptr next) diff --git a/test/bounded_pointer.hpp b/test/bounded_pointer.hpp index 008c414..86533f9 100644 --- a/test/bounded_pointer.hpp +++ b/test/bounded_pointer.hpp @@ -31,6 +31,7 @@ class bounded_reference; template < typename T > class bounded_allocator; +struct maintain_offset_t{}; template < typename T > class bounded_pointer @@ -41,6 +42,7 @@ class bounded_pointer public: typedef typename boost::intrusive::detail::remove_const< T >::type mut_val_t; + typedef bounded_pointer< mut_val_t > non_const_t; typedef const mut_val_t const_val_t; typedef bounded_reference reference; @@ -59,6 +61,10 @@ class bounded_pointer : m_offset(other.m_offset) {} + bounded_pointer(maintain_offset_t, unsigned char offset) + : m_offset(offset) + {} + bounded_pointer& operator = (const bounded_pointer& other) { m_offset = other.m_offset; return *this; } @@ -67,11 +73,8 @@ class bounded_pointer operator= (const bounded_pointer & other) { m_offset = other.m_offset; return *this; } - const bounded_pointer< typename boost::intrusive::detail::remove_const< T >::type >& unconst() const - { return *reinterpret_cast< const bounded_pointer< typename boost::intrusive::detail::remove_const< T >::type >* >(this); } - - bounded_pointer< typename boost::intrusive::detail::remove_const< T >::type >& unconst() - { return *reinterpret_cast< bounded_pointer< typename boost::intrusive::detail::remove_const< T >::type >* >(this); } + non_const_t unconst() const + { return non_const_t (maintain_offset_t(), this->m_offset); } static mut_val_t* base() { diff --git a/test/generic_multiset_test.hpp b/test/generic_multiset_test.hpp index 472bf42..40288dd 100644 --- a/test/generic_multiset_test.hpp +++ b/test/generic_multiset_test.hpp @@ -233,7 +233,6 @@ void test_generic_multiset::test_find(value_cont_type& values) typedef typename multiset_type::key_of_value key_of_value; multiset_type testset (values.begin(), values.end()); typedef typename multiset_type::iterator iterator; - typedef typename multiset_type::const_iterator const_iterator; { value_cont_type cmp_val_cont(1); @@ -255,9 +254,8 @@ void test_generic_multiset::test_find(value_cont_type& values) BOOST_TEST (testset.find (7, any_less()) == testset.end()); } { //1, 2, 2, 3, 4, 5 - const multiset_type &const_testset = testset; + std::pair range; - std::pair const_range; value_cont_type cmp_val_cont(2); typename value_cont_type::reference cmp_val_lower = cmp_val_cont.front(); typename value_cont_type::reference cmp_val_upper = cmp_val_cont.back(); @@ -271,6 +269,9 @@ void test_generic_multiset::test_find(value_cont_type& values) BOOST_TEST (range.second->value_ == 3); BOOST_TEST (boost::intrusive::iterator_distance (range.first, range.second) == 3); } + const multiset_type &const_testset = testset; + typedef typename multiset_type::const_iterator const_iterator; + std::pair const_range; { (&cmp_val_lower)->value_ = 1; (&cmp_val_upper)->value_ = 2; diff --git a/test/stateful_value_traits_test.cpp b/test/stateful_value_traits_test.cpp index 7b3d72a..98f557e 100644 --- a/test/stateful_value_traits_test.cpp +++ b/test/stateful_value_traits_test.cpp @@ -63,10 +63,10 @@ struct stateful_value_traits const_node_ptr to_node_ptr (const value_type &value) const { return node_array_ + (&value - values_); } - pointer to_value_ptr(const node_ptr &n) const + pointer to_value_ptr(node_ptr n) const { return values_ + (n - node_array_); } - const_pointer to_value_ptr(const const_node_ptr &n) const + const_pointer to_value_ptr(const_node_ptr n) const { return values_ + (n - node_array_); } pointer values_;