diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index e58a602..ea7e8f5 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -34,6 +34,9 @@ doxygen autodoc \"BOOST_RV_REF(T)=T &&\" \\ \"BOOST_RV_REF_BEG=\" \\ \"BOOST_RV_REF_END=&&\" \\ + \"BOOST_NOEXCEPT_OR_NOTHROW=noexcept\" \\ + \"BOOST_NOEXCEPT_IF(T)=noexcept(T)\" \\ + \"BOOST_NOEXCEPT=noexcept\" \\ \"BOOST_INTRUSIVE_FORCEINLINE=inline\" \\ \"list_impl=list\" \\ \"slist_impl=slist\" \\ diff --git a/doc/intrusive.qbk b/doc/intrusive.qbk index cd3b3f0..ccd75f4 100644 --- a/doc/intrusive.qbk +++ b/doc/intrusive.qbk @@ -3888,8 +3888,11 @@ to be inserted in intrusive containers are allocated using `std::vector` or `std [section:release_notes_boost_1_77_00 Boost 1.77 Release] +* Added `noexcept` support to the library to obtain better performance and diagnostics. + * Fixed bugs: * [@https://github.com/boostorg/intrusive/pull/57 GitHub #57: ['UB: comparing unrelated pointers]] + * [@https://github.com/boostorg/intrusive/issues/59 GitHub #59: ['Add noexcept support to the library]] * [@https://github.com/boostorg/intrusive/issues/60 GitHub #60: ['Licensing question for math.hpp]] [endsect] diff --git a/include/boost/intrusive/any_hook.hpp b/include/boost/intrusive/any_hook.hpp index 6d18781..72abc9e 100644 --- a/include/boost/intrusive/any_hook.hpp +++ b/include/boost/intrusive/any_hook.hpp @@ -194,7 +194,7 @@ class any_member_hook //! initializes the node to an unlinked state. //! //! Throws: Nothing. - any_member_hook(); + any_member_hook() BOOST_NOEXCEPT; //! Effects: If link_mode is or \c safe_link //! initializes the node to an unlinked state. The argument is ignored. @@ -205,7 +205,7 @@ class any_member_hook //! makes classes using the hook STL-compliant without forcing the //! user to do some additional work. \c swap can be used to emulate //! move-semantics. - any_member_hook(const any_member_hook& ); + any_member_hook(const any_member_hook&) BOOST_NOEXCEPT; //! Effects: Empty function. The argument is ignored. //! @@ -215,7 +215,7 @@ class any_member_hook //! makes classes using the hook STL-compliant without forcing the //! user to do some additional work. \c swap can be used to emulate //! move-semantics. - any_member_hook& operator=(const any_member_hook& ); + any_member_hook& operator=(const any_member_hook&) BOOST_NOEXCEPT; //! Effects: If link_mode is \c normal_link, the destructor does //! nothing (ie. no code is generated). If link_mode is \c safe_link and the @@ -231,7 +231,7 @@ class any_member_hook //! will return a valid iterator. //! //! Complexity: Constant - bool is_linked() const; + bool is_linked() const BOOST_NOEXCEPT; #endif }; diff --git a/include/boost/intrusive/avl_set.hpp b/include/boost/intrusive/avl_set.hpp index d714ab1..b03d304 100644 --- a/include/boost/intrusive/avl_set.hpp +++ b/include/boost/intrusive/avl_set.hpp @@ -120,22 +120,22 @@ class avl_set_impl ~avl_set_impl(); //! @copydoc ::boost::intrusive::avltree::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::begin() reverse_iterator avlegin(); @@ -144,37 +144,37 @@ class avl_set_impl const_reverse_iterator avlegin() const; //! @copydoc ::boost::intrusive::avltree::crbegin()const - const_reverse_iterator crbegin() const; + const_reverse_iterator crbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::rend() - reverse_iterator rend(); + reverse_iterator rend() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::rend()const - const_reverse_iterator rend() const; + const_reverse_iterator rend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::crend()const - const_reverse_iterator crend() const; + const_reverse_iterator crend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::root() - iterator root(); + iterator root() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::root()const - const_iterator root() const; + const_iterator root() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::croot()const - const_iterator croot() const; + const_iterator croot() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::container_from_end_iterator(iterator) - static avl_set_impl &container_from_end_iterator(iterator end_iterator); + static avl_set_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::container_from_end_iterator(const_iterator) - static const avl_set_impl &container_from_end_iterator(const_iterator end_iterator); + static const avl_set_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::container_from_iterator(iterator) - static avl_set_impl &container_from_iterator(iterator it); + static avl_set_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::container_from_iterator(const_iterator) - static const avl_set_impl &container_from_iterator(const_iterator it); + static const avl_set_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::key_comp()const key_compare key_comp() const; @@ -183,10 +183,10 @@ class avl_set_impl value_compare value_comp() const; //! @copydoc ::boost::intrusive::avltree::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::swap void swap(avl_set_impl& other); @@ -244,24 +244,24 @@ class avl_set_impl { tree_type::insert_unique(b, e); } //! @copydoc ::boost::intrusive::avltree::insert_unique_commit - iterator insert_commit(reference value, const insert_commit_data &commit_data) + iterator insert_commit(reference value, const insert_commit_data &commit_data) BOOST_NOEXCEPT { return tree_type::insert_unique_commit(value, commit_data); } #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::avltree::insert_before - iterator insert_before(const_iterator pos, reference value); + iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::push_back - void push_back(reference value); + void push_back(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::push_front - void push_front(reference value); + void push_front(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::erase(const_iterator) - iterator erase(const_iterator i); + iterator erase(const_iterator i) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::erase(const_iterator,const_iterator) - iterator erase(const_iterator b, const_iterator e); + iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::erase(const key_type &key) size_type erase(const key_type &key); @@ -272,11 +272,11 @@ class avl_set_impl //! @copydoc ::boost::intrusive::avltree::erase_and_dispose(const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator i, Disposer disposer); + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::erase_and_dispose(const_iterator,const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::erase_and_dispose(const key_type &, Disposer) template @@ -287,11 +287,11 @@ class avl_set_impl size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer); //! @copydoc ::boost::intrusive::avltree::clear - void clear(); + void clear() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::clear_and_dispose template - void clear_and_dispose(Disposer disposer); + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT; #endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED @@ -391,28 +391,28 @@ class avl_set_impl (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const; //! @copydoc ::boost::intrusive::avltree::s_iterator_to(reference) - static iterator s_iterator_to(reference value); + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::s_iterator_to(const_reference) - static const_iterator s_iterator_to(const_reference value); + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::init_node(reference) - static void init_node(reference value); + static void init_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::unlink_leftmost_without_rebalance - pointer unlink_leftmost_without_rebalance(); + pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::replace_node - void replace_node(iterator replace_this, reference with_this); + void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::remove_node - void remove_node(reference value); + void remove_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::merge_unique template @@ -555,16 +555,16 @@ class avl_set BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(avl_set) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static avl_set &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static avl_set &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const avl_set &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const avl_set &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static avl_set &container_from_iterator(iterator it) + BOOST_INTRUSIVE_FORCEINLINE static avl_set &container_from_iterator(iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } - BOOST_INTRUSIVE_FORCEINLINE static const avl_set &container_from_iterator(const_iterator it) + BOOST_INTRUSIVE_FORCEINLINE static const avl_set &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } }; @@ -657,61 +657,61 @@ class avl_multiset_impl ~avl_multiset_impl(); //! @copydoc ::boost::intrusive::avltree::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::rbegin() - reverse_iterator rbegin(); + reverse_iterator rbegin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::rbegin()const - const_reverse_iterator rbegin() const; + const_reverse_iterator rbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::crbegin()const - const_reverse_iterator crbegin() const; + const_reverse_iterator crbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::rend() - reverse_iterator rend(); + reverse_iterator rend() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::rend()const - const_reverse_iterator rend() const; + const_reverse_iterator rend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::crend()const - const_reverse_iterator crend() const; + const_reverse_iterator crend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::root() - iterator root(); + iterator root() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::root()const - const_iterator root() const; + const_iterator root() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::croot()const - const_iterator croot() const; + const_iterator croot() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::container_from_end_iterator(iterator) - static avl_multiset_impl &container_from_end_iterator(iterator end_iterator); + static avl_multiset_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::container_from_end_iterator(const_iterator) - static const avl_multiset_impl &container_from_end_iterator(const_iterator end_iterator); + static const avl_multiset_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::container_from_iterator(iterator) - static avl_multiset_impl &container_from_iterator(iterator it); + static avl_multiset_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::container_from_iterator(const_iterator) - static const avl_multiset_impl &container_from_iterator(const_iterator it); + static const avl_multiset_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::key_comp()const key_compare key_comp() const; @@ -720,10 +720,10 @@ class avl_multiset_impl value_compare value_comp() const; //! @copydoc ::boost::intrusive::avltree::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::swap void swap(avl_multiset_impl& other); @@ -758,19 +758,19 @@ class avl_multiset_impl #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::avltree::insert_before - iterator insert_before(const_iterator pos, reference value); + iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::push_back - void push_back(reference value); + void push_back(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::push_front - void push_front(reference value); + void push_front(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::erase(const_iterator) - iterator erase(const_iterator i); + iterator erase(const_iterator i) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::erase(const_iterator,const_iterator) - iterator erase(const_iterator b, const_iterator e); + iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::erase(const key_type &) size_type erase(const key_type &key); @@ -781,11 +781,11 @@ class avl_multiset_impl //! @copydoc ::boost::intrusive::avltree::erase_and_dispose(const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator i, Disposer disposer); + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::erase_and_dispose(const_iterator,const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::erase_and_dispose(const key_type &, Disposer) template @@ -796,11 +796,11 @@ class avl_multiset_impl size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer); //! @copydoc ::boost::intrusive::avltree::clear - void clear(); + void clear() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::clear_and_dispose template - void clear_and_dispose(Disposer disposer); + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::count(const key_type &)const size_type count(const key_type &key) const; @@ -886,28 +886,28 @@ class avl_multiset_impl (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const; //! @copydoc ::boost::intrusive::avltree::s_iterator_to(reference) - static iterator s_iterator_to(reference value); + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::s_iterator_to(const_reference) - static const_iterator s_iterator_to(const_reference value); + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::init_node(reference) - static void init_node(reference value); + static void init_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::unlink_leftmost_without_rebalance - pointer unlink_leftmost_without_rebalance(); + pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::replace_node - void replace_node(iterator replace_this, reference with_this); + void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::remove_node - void remove_node(reference value); + void remove_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::avltree::merge_equal template @@ -1050,16 +1050,16 @@ class avl_multiset BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(avl_multiset) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static avl_multiset &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static avl_multiset &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const avl_multiset &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const avl_multiset &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static avl_multiset &container_from_iterator(iterator it) + BOOST_INTRUSIVE_FORCEINLINE static avl_multiset &container_from_iterator(iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } - BOOST_INTRUSIVE_FORCEINLINE static const avl_multiset &container_from_iterator(const_iterator it) + BOOST_INTRUSIVE_FORCEINLINE static const avl_multiset &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } }; diff --git a/include/boost/intrusive/avltree.hpp b/include/boost/intrusive/avltree.hpp index b80cb93..747d41c 100644 --- a/include/boost/intrusive/avltree.hpp +++ b/include/boost/intrusive/avltree.hpp @@ -154,61 +154,61 @@ class avltree_impl ~avltree_impl(); //! @copydoc ::boost::intrusive::bstree::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rbegin() - reverse_iterator rbegin(); + reverse_iterator rbegin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rbegin()const - const_reverse_iterator rbegin() const; + const_reverse_iterator rbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::crbegin()const - const_reverse_iterator crbegin() const; + const_reverse_iterator crbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rend() - reverse_iterator rend(); + reverse_iterator rend() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rend()const - const_reverse_iterator rend() const; + const_reverse_iterator rend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::crend()const - const_reverse_iterator crend() const; + const_reverse_iterator crend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::root() - iterator root(); + iterator root() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::root()const - const_iterator root() const; + const_iterator root() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::croot()const - const_iterator croot() const; + const_iterator croot() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(iterator) - static avltree_impl &container_from_end_iterator(iterator end_iterator); + static avltree_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(const_iterator) - static const avltree_impl &container_from_end_iterator(const_iterator end_iterator); + static const avltree_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_iterator(iterator) - static avltree_impl &container_from_iterator(iterator it); + static avltree_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_iterator(const_iterator) - static const avltree_impl &container_from_iterator(const_iterator it); + static const avltree_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::key_comp()const key_compare key_comp() const; @@ -217,10 +217,10 @@ class avltree_impl value_compare value_comp() const; //! @copydoc ::boost::intrusive::bstree::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::swap void swap(avltree_impl& other); @@ -278,26 +278,26 @@ class avltree_impl (const_iterator hint, const key_type &key, insert_commit_data &commit_data); //! @copydoc ::boost::intrusive::bstree::insert_unique_commit - iterator insert_unique_commit(reference value, const insert_commit_data &commit_data); + iterator insert_unique_commit(reference value, const insert_commit_data &commit_data) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::insert_unique(Iterator,Iterator) template void insert_unique(Iterator b, Iterator e); //! @copydoc ::boost::intrusive::bstree::insert_before - iterator insert_before(const_iterator pos, reference value); + iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::push_back - void push_back(reference value); + void push_back(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::push_front - void push_front(reference value); + void push_front(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase(const_iterator) - iterator erase(const_iterator i); + iterator erase(const_iterator i) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase(const_iterator,const_iterator) - iterator erase(const_iterator b, const_iterator e); + iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase(const key_type &) size_type erase(const key_type &key); @@ -308,11 +308,11 @@ class avltree_impl //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator i, Disposer disposer); + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const key_type &, Disposer) template @@ -323,11 +323,11 @@ class avltree_impl size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer); //! @copydoc ::boost::intrusive::bstree::clear - void clear(); + void clear() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::clear_and_dispose template - void clear_and_dispose(Disposer disposer); + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::count(const key_type &ke)const size_type count(const key_type &key) const; @@ -413,28 +413,28 @@ class avltree_impl (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const; //! @copydoc ::boost::intrusive::bstree::s_iterator_to(reference) - static iterator s_iterator_to(reference value); + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::s_iterator_to(const_reference) - static const_iterator s_iterator_to(const_reference value); + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::init_node(reference) - static void init_node(reference value); + static void init_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::unlink_leftmost_without_rebalance - pointer unlink_leftmost_without_rebalance(); + pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::replace_node - void replace_node(iterator replace_this, reference with_this); + void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::remove_node - void remove_node(reference value); + void remove_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::merge_unique(bstree&) template @@ -565,16 +565,16 @@ class avltree BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(avltree) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static avltree &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static avltree &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const avltree &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const avltree &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static avltree &container_from_iterator(iterator it) + BOOST_INTRUSIVE_FORCEINLINE static avltree &container_from_iterator(iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } - BOOST_INTRUSIVE_FORCEINLINE static const avltree &container_from_iterator(const_iterator it) + BOOST_INTRUSIVE_FORCEINLINE static const avltree &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } }; diff --git a/include/boost/intrusive/avltree_algorithms.hpp b/include/boost/intrusive/avltree_algorithms.hpp index 1d206cd..d360a20 100644 --- a/include/boost/intrusive/avltree_algorithms.hpp +++ b/include/boost/intrusive/avltree_algorithms.hpp @@ -167,21 +167,21 @@ 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); + static node_ptr get_header(const const_node_ptr & n) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::begin_node - static node_ptr begin_node(const const_node_ptr & header); + static node_ptr begin_node(const const_node_ptr & header) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::end_node - static node_ptr end_node(const const_node_ptr & header); + static node_ptr end_node(const const_node_ptr & header) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::swap_tree - static void swap_tree(node_ptr header1, node_ptr header2); + static void swap_tree(node_ptr header1, node_ptr header2) BOOST_NOEXCEPT; #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr) - static void swap_nodes(node_ptr node1, node_ptr node2) + static void swap_nodes(node_ptr node1, node_ptr node2) BOOST_NOEXCEPT { if(node1 == node2) return; @@ -191,7 +191,7 @@ class avltree_algorithms } //! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr,node_ptr,node_ptr) - static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2) + static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2) BOOST_NOEXCEPT { if(node1 == node2) return; @@ -203,7 +203,7 @@ class avltree_algorithms } //! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr) - static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node) + static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node) BOOST_NOEXCEPT { if(node_to_be_replaced == new_node) return; @@ -211,14 +211,14 @@ class avltree_algorithms } //! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr,node_ptr) - static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node) + static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node) BOOST_NOEXCEPT { bstree_algo::replace_node(node_to_be_replaced, header, new_node); NodeTraits::set_balance(new_node, NodeTraits::get_balance(node_to_be_replaced)); } //! @copydoc ::boost::intrusive::bstree_algorithms::unlink(node_ptr) - static void unlink(node_ptr node) + static void unlink(node_ptr node) BOOST_NOEXCEPT { node_ptr x = NodeTraits::get_parent(node); if(x){ @@ -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); + static node_ptr unlink_leftmost_without_rebalance(const node_ptr & header) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::unique(const const_node_ptr&) - static bool unique(const const_node_ptr & node); + static bool unique(const 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); + static std::size_t size(const 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); + static node_ptr next_node(const node_ptr & node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::prev_node(const node_ptr&) - static node_ptr prev_node(const node_ptr & node); + static node_ptr prev_node(const node_ptr & node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::init(node_ptr) - static void init(const node_ptr & node); + static void init(const node_ptr & node) BOOST_NOEXCEPT; #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! Requires: node must not be part of any tree. @@ -258,14 +258,14 @@ class avltree_algorithms //! Throws: Nothing. //! //! Nodes: If node is inserted in a tree, this function corrupts the tree. - static void init_header(node_ptr header) + static void init_header(node_ptr header) BOOST_NOEXCEPT { bstree_algo::init_header(header); NodeTraits::set_balance(header, NodeTraits::zero()); } //! @copydoc ::boost::intrusive::bstree_algorithms::erase(node_ptr,node_ptr) - static node_ptr erase(node_ptr header, node_ptr z) + static node_ptr erase(node_ptr header, node_ptr z) BOOST_NOEXCEPT { typename bstree_algo::data_for_rebalance info; bstree_algo::erase(header, z, info); @@ -310,7 +310,7 @@ class avltree_algorithms #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree_algorithms::clear_and_dispose(const node_ptr&,Disposer) template - static void clear_and_dispose(const node_ptr & header, Disposer disposer); + static void clear_and_dispose(const node_ptr & header, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) template @@ -376,7 +376,7 @@ class avltree_algorithms //! @copydoc ::boost::intrusive::bstree_algorithms::insert_before(node_ptr,node_ptr,node_ptr) static node_ptr insert_before - (node_ptr header, node_ptr pos, node_ptr new_node) + (node_ptr header, node_ptr pos, node_ptr new_node) BOOST_NOEXCEPT { bstree_algo::insert_before(header, pos, new_node); rebalance_after_insertion(header, new_node); @@ -384,14 +384,14 @@ class avltree_algorithms } //! @copydoc ::boost::intrusive::bstree_algorithms::push_back(node_ptr,node_ptr) - static void push_back(node_ptr header, node_ptr new_node) + static void push_back(node_ptr header, node_ptr new_node) BOOST_NOEXCEPT { bstree_algo::push_back(header, new_node); rebalance_after_insertion(header, new_node); } //! @copydoc ::boost::intrusive::bstree_algorithms::push_front(node_ptr,node_ptr) - static void push_front(node_ptr header, node_ptr new_node) + static void push_front(node_ptr header, node_ptr new_node) BOOST_NOEXCEPT { bstree_algo::push_front(header, new_node); rebalance_after_insertion(header, new_node); @@ -413,14 +413,14 @@ class avltree_algorithms //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_commit(node_ptr,node_ptr,const insert_commit_data &) static void insert_unique_commit - (node_ptr header, node_ptr new_value, const insert_commit_data &commit_data) + (node_ptr header, node_ptr new_value, const insert_commit_data &commit_data) BOOST_NOEXCEPT { bstree_algo::insert_unique_commit(header, new_value, commit_data); rebalance_after_insertion(header, new_value); } //! @copydoc ::boost::intrusive::bstree_algorithms::is_header - static bool is_header(const const_node_ptr & p) + static bool is_header(const const_node_ptr & p) BOOST_NOEXCEPT { return NodeTraits::get_balance(p) == NodeTraits::zero() && bstree_algo::is_header(p); } @@ -483,7 +483,7 @@ class avltree_algorithms } static void rebalance_after_erasure - ( node_ptr header, node_ptr z, const typename bstree_algo::data_for_rebalance &info) + ( node_ptr header, node_ptr z, const typename bstree_algo::data_for_rebalance &info) BOOST_NOEXCEPT { if(info.y != z){ NodeTraits::set_balance(info.y, NodeTraits::get_balance(z)); @@ -492,7 +492,7 @@ class avltree_algorithms rebalance_after_erasure_restore_invariants(header, info.x, info.x_parent); } - static void rebalance_after_erasure_restore_invariants(node_ptr header, node_ptr x, node_ptr x_parent) + static void rebalance_after_erasure_restore_invariants(node_ptr header, node_ptr x, node_ptr x_parent) BOOST_NOEXCEPT { for ( node_ptr root = NodeTraits::get_parent(header) ; x != root @@ -560,7 +560,7 @@ class avltree_algorithms } } - static void rebalance_after_insertion(node_ptr header, node_ptr x) + static void rebalance_after_insertion(node_ptr header, node_ptr x) BOOST_NOEXCEPT { NodeTraits::set_balance(x, NodeTraits::zero()); // Rebalance. @@ -605,7 +605,7 @@ class avltree_algorithms } } - static void left_right_balancing(node_ptr a, node_ptr b, node_ptr c) + static void left_right_balancing(node_ptr a, node_ptr b, node_ptr c) BOOST_NOEXCEPT { // balancing... const balance c_balance = NodeTraits::get_balance(c); @@ -630,7 +630,7 @@ class avltree_algorithms } } - static node_ptr avl_rotate_left_right(const node_ptr a, const node_ptr a_oldleft, node_ptr hdr) + static node_ptr avl_rotate_left_right(const node_ptr a, const node_ptr a_oldleft, node_ptr hdr) BOOST_NOEXCEPT { // [note: 'a_oldleft' is 'b'] // | | // // a(-2) c // @@ -650,7 +650,7 @@ class avltree_algorithms return c; } - static node_ptr avl_rotate_right_left(const node_ptr a, const node_ptr a_oldright, node_ptr hdr) + static node_ptr avl_rotate_right_left(const node_ptr a, const node_ptr a_oldright, node_ptr hdr) BOOST_NOEXCEPT { // [note: 'a_oldright' is 'b'] // | | // // a(pos) c // @@ -670,7 +670,7 @@ class avltree_algorithms return c; } - static void avl_rotate_left(node_ptr x, node_ptr x_oldright, node_ptr hdr) + static void avl_rotate_left(node_ptr x, node_ptr x_oldright, node_ptr hdr) BOOST_NOEXCEPT { bstree_algo::rotate_left(x, x_oldright, NodeTraits::get_parent(x), hdr); @@ -685,7 +685,7 @@ class avltree_algorithms } } - static void avl_rotate_right(node_ptr x, node_ptr x_oldleft, node_ptr hdr) + static void avl_rotate_right(node_ptr x, node_ptr x_oldleft, node_ptr hdr) BOOST_NOEXCEPT { bstree_algo::rotate_right(x, x_oldleft, NodeTraits::get_parent(x), hdr); diff --git a/include/boost/intrusive/bs_set.hpp b/include/boost/intrusive/bs_set.hpp index cbb2a35..1755dec 100644 --- a/include/boost/intrusive/bs_set.hpp +++ b/include/boost/intrusive/bs_set.hpp @@ -117,61 +117,61 @@ class bs_set_impl ~bs_set_impl(); //! @copydoc ::boost::intrusive::bstree::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rbegin() - reverse_iterator rbegin(); + reverse_iterator rbegin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rbegin()const - const_reverse_iterator rbegin() const; + const_reverse_iterator rbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::crbegin()const - const_reverse_iterator crbegin() const; + const_reverse_iterator crbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rend() - reverse_iterator rend(); + reverse_iterator rend() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rend()const - const_reverse_iterator rend() const; + const_reverse_iterator rend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::crend()const - const_reverse_iterator crend() const; + const_reverse_iterator crend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::root() - iterator root(); + iterator root() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::root()const - const_iterator root() const; + const_iterator root() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::croot()const - const_iterator croot() const; + const_iterator croot() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(iterator) - static bs_set_impl &container_from_end_iterator(iterator end_iterator); + static bs_set_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(const_iterator) - static const bs_set_impl &container_from_end_iterator(const_iterator end_iterator); + static const bs_set_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_iterator(iterator) - static bs_set_impl &container_from_iterator(iterator it); + static bs_set_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_iterator(const_iterator) - static const bs_set_impl &container_from_iterator(const_iterator it); + static const bs_set_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::key_comp()const key_compare key_comp() const; @@ -180,10 +180,10 @@ class bs_set_impl value_compare value_comp() const; //! @copydoc ::boost::intrusive::bstree::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::swap void swap(bs_set_impl& other); @@ -241,24 +241,24 @@ class bs_set_impl { tree_type::insert_unique(b, e); } //! @copydoc ::boost::intrusive::bstree::insert_unique_commit - iterator insert_commit(reference value, const insert_commit_data &commit_data) + iterator insert_commit(reference value, const insert_commit_data &commit_data) BOOST_NOEXCEPT { return tree_type::insert_unique_commit(value, commit_data); } #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree::insert_before - iterator insert_before(const_iterator pos, reference value); + iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::push_back - void push_back(reference value); + void push_back(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::push_front - void push_front(reference value); + void push_front(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase(const_iterator) - iterator erase(const_iterator i); + iterator erase(const_iterator i) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase(const_iterator,const_iterator) - iterator erase(const_iterator b, const_iterator e); + iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase(const key_type &) size_type erase(const key_type &key); @@ -269,11 +269,11 @@ class bs_set_impl //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator i, Disposer disposer); + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const key_type &, Disposer) template @@ -284,11 +284,11 @@ class bs_set_impl size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer); //! @copydoc ::boost::intrusive::bstree::clear - void clear(); + void clear() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::clear_and_dispose template - void clear_and_dispose(Disposer disposer); + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT; #endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED @@ -388,28 +388,28 @@ class bs_set_impl (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const; //! @copydoc ::boost::intrusive::bstree::s_iterator_to(reference) - static iterator s_iterator_to(reference value); + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::s_iterator_to(const_reference) - static const_iterator s_iterator_to(const_reference value); + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::init_node(reference) - static void init_node(reference value); + static void init_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::unlink_leftmost_without_rebalance - pointer unlink_leftmost_without_rebalance(); + pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::replace_node - void replace_node(iterator replace_this, reference with_this); + void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::remove_node - void remove_node(reference value); + void remove_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::merge_unique template @@ -552,16 +552,16 @@ class bs_set BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(bs_set) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static bs_set &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static bs_set &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const bs_set &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const bs_set &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static bs_set &container_from_iterator(iterator it) + BOOST_INTRUSIVE_FORCEINLINE static bs_set &container_from_iterator(iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } - BOOST_INTRUSIVE_FORCEINLINE static const bs_set &container_from_iterator(const_iterator it) + BOOST_INTRUSIVE_FORCEINLINE static const bs_set &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } }; @@ -653,61 +653,61 @@ class bs_multiset_impl ~bs_multiset_impl(); //! @copydoc ::boost::intrusive::bstree::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rbegin() - reverse_iterator rbegin(); + reverse_iterator rbegin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rbegin()const - const_reverse_iterator rbegin() const; + const_reverse_iterator rbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::crbegin()const - const_reverse_iterator crbegin() const; + const_reverse_iterator crbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rend() - reverse_iterator rend(); + reverse_iterator rend() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rend()const - const_reverse_iterator rend() const; + const_reverse_iterator rend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::crend()const - const_reverse_iterator crend() const; + const_reverse_iterator crend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::root() - iterator root(); + iterator root() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::root()const - const_iterator root() const; + const_iterator root() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::croot()const - const_iterator croot() const; + const_iterator croot() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(iterator) - static bs_multiset_impl &container_from_end_iterator(iterator end_iterator); + static bs_multiset_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(const_iterator) - static const bs_multiset_impl &container_from_end_iterator(const_iterator end_iterator); + static const bs_multiset_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_iterator(iterator) - static bs_multiset_impl &container_from_iterator(iterator it); + static bs_multiset_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_iterator(const_iterator) - static const bs_multiset_impl &container_from_iterator(const_iterator it); + static const bs_multiset_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::key_comp()const key_compare key_comp() const; @@ -716,10 +716,10 @@ class bs_multiset_impl value_compare value_comp() const; //! @copydoc ::boost::intrusive::bstree::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::swap void swap(bs_multiset_impl& other); @@ -754,19 +754,19 @@ class bs_multiset_impl #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree::insert_before - iterator insert_before(const_iterator pos, reference value); + iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::push_back - void push_back(reference value); + void push_back(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::push_front - void push_front(reference value); + void push_front(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase(const_iterator) - iterator erase(const_iterator i); + iterator erase(const_iterator i) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase(const_iterator,const_iterator) - iterator erase(const_iterator b, const_iterator e); + iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase(const key_type &) size_type erase(const key_type &key); @@ -777,11 +777,11 @@ class bs_multiset_impl //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator i, Disposer disposer); + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const key_type &, Disposer) template @@ -792,11 +792,11 @@ class bs_multiset_impl size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer); //! @copydoc ::boost::intrusive::bstree::clear - void clear(); + void clear() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::clear_and_dispose template - void clear_and_dispose(Disposer disposer); + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::count(const key_type &)const size_type count(const key_type &key) const; @@ -882,28 +882,28 @@ class bs_multiset_impl (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const; //! @copydoc ::boost::intrusive::bstree::s_iterator_to(reference) - static iterator s_iterator_to(reference value); + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::s_iterator_to(const_reference) - static const_iterator s_iterator_to(const_reference value); + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::init_node(reference) - static void init_node(reference value); + static void init_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::unlink_leftmost_without_rebalance - pointer unlink_leftmost_without_rebalance(); + pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::replace_node - void replace_node(iterator replace_this, reference with_this); + void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::remove_node - void remove_node(reference value); + void remove_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::merge_equal template @@ -1046,16 +1046,16 @@ class bs_multiset BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(bs_multiset) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static bs_multiset &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static bs_multiset &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const bs_multiset &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const bs_multiset &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static bs_multiset &container_from_iterator(iterator it) + BOOST_INTRUSIVE_FORCEINLINE static bs_multiset &container_from_iterator(iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } - BOOST_INTRUSIVE_FORCEINLINE static const bs_multiset &container_from_iterator(const_iterator it) + BOOST_INTRUSIVE_FORCEINLINE static const bs_multiset &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } }; diff --git a/include/boost/intrusive/bstree.hpp b/include/boost/intrusive/bstree.hpp index f9d4c3c..de604dd 100644 --- a/include/boost/intrusive/bstree.hpp +++ b/include/boost/intrusive/bstree.hpp @@ -145,22 +145,22 @@ struct bstbase3 BOOST_INTRUSIVE_FORCEINLINE const_value_traits_ptr priv_value_traits_ptr() const { return pointer_traits::pointer_to(this->get_value_traits()); } - iterator begin() + BOOST_INTRUSIVE_FORCEINLINE iterator begin() BOOST_NOEXCEPT { return iterator(node_algorithms::begin_node(this->header_ptr()), this->priv_value_traits_ptr()); } - BOOST_INTRUSIVE_FORCEINLINE const_iterator begin() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator begin() const BOOST_NOEXCEPT { return cbegin(); } - const_iterator cbegin() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator cbegin() const BOOST_NOEXCEPT { return const_iterator(node_algorithms::begin_node(this->header_ptr()), this->priv_value_traits_ptr()); } - iterator end() + BOOST_INTRUSIVE_FORCEINLINE iterator end() BOOST_NOEXCEPT { return iterator(node_algorithms::end_node(this->header_ptr()), this->priv_value_traits_ptr()); } - BOOST_INTRUSIVE_FORCEINLINE const_iterator end() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator end() const BOOST_NOEXCEPT { return cend(); } - BOOST_INTRUSIVE_FORCEINLINE const_iterator cend() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator cend() const BOOST_NOEXCEPT { return const_iterator(node_algorithms::end_node(this->header_ptr()), this->priv_value_traits_ptr()); } BOOST_INTRUSIVE_FORCEINLINE iterator root() @@ -195,32 +195,32 @@ struct bstbase3 node_algorithms::replace_node( get_value_traits().to_node_ptr(*replace_this) , this->header_ptr() , get_value_traits().to_node_ptr(with_this)); - if(safemode_or_autounlink) + BOOST_IF_CONSTEXPR(safemode_or_autounlink) node_algorithms::init(replace_this.pointed_node()); } - BOOST_INTRUSIVE_FORCEINLINE void rebalance() + BOOST_INTRUSIVE_FORCEINLINE void rebalance() BOOST_NOEXCEPT { node_algorithms::rebalance(this->header_ptr()); } - iterator rebalance_subtree(iterator root) + iterator rebalance_subtree(iterator root) BOOST_NOEXCEPT { return iterator(node_algorithms::rebalance_subtree(root.pointed_node()), this->priv_value_traits_ptr()); } - static iterator s_iterator_to(reference value) + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT((!stateful_value_traits)); return iterator (value_traits::to_node_ptr(value), const_value_traits_ptr()); } - static const_iterator s_iterator_to(const_reference value) + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT((!stateful_value_traits)); return const_iterator (value_traits::to_node_ptr(*pointer_traits::const_cast_from(pointer_traits::pointer_to(value))), const_value_traits_ptr()); } - iterator iterator_to(reference value) + iterator iterator_to(reference value) BOOST_NOEXCEPT { return iterator (this->get_value_traits().to_node_ptr(value), this->priv_value_traits_ptr()); } - const_iterator iterator_to(const_reference value) const + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT { return const_iterator (this->get_value_traits().to_node_ptr(*pointer_traits::const_cast_from(pointer_traits::pointer_to(value))), this->priv_value_traits_ptr()); } BOOST_INTRUSIVE_FORCEINLINE static void init_node(reference value) @@ -761,42 +761,42 @@ class bstree_impl //! Complexity: Constant. //! //! Throws: Nothing. - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! Effects: Returns a const_iterator pointing to the beginning of the container. //! //! Complexity: Constant. //! //! Throws: Nothing. - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! Effects: Returns a const_iterator pointing to the beginning of the container. //! //! Complexity: Constant. //! //! Throws: Nothing. - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! Effects: Returns an iterator pointing to the end of the container. //! //! Complexity: Constant. //! //! Throws: Nothing. - iterator end(); + iterator end() BOOST_NOEXCEPT; //! Effects: Returns a const_iterator pointing to the end of the container. //! //! Complexity: Constant. //! //! Throws: Nothing. - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! Effects: Returns a const_iterator pointing to the end of the container. //! //! Complexity: Constant. //! //! Throws: Nothing. - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! Effects: Returns a reverse_iterator pointing to the beginning of the //! reversed container. @@ -804,7 +804,7 @@ class bstree_impl //! Complexity: Constant. //! //! Throws: Nothing. - reverse_iterator rbegin(); + reverse_iterator rbegin() BOOST_NOEXCEPT; //! Effects: Returns a const_reverse_iterator pointing to the beginning //! of the reversed container. @@ -812,7 +812,7 @@ class bstree_impl //! Complexity: Constant. //! //! Throws: Nothing. - const_reverse_iterator rbegin() const; + const_reverse_iterator rbegin() const BOOST_NOEXCEPT; //! Effects: Returns a const_reverse_iterator pointing to the beginning //! of the reversed container. @@ -820,7 +820,7 @@ class bstree_impl //! Complexity: Constant. //! //! Throws: Nothing. - const_reverse_iterator crbegin() const; + const_reverse_iterator crbegin() const BOOST_NOEXCEPT; //! Effects: Returns a reverse_iterator pointing to the end //! of the reversed container. @@ -828,7 +828,7 @@ class bstree_impl //! Complexity: Constant. //! //! Throws: Nothing. - reverse_iterator rend(); + reverse_iterator rend() BOOST_NOEXCEPT; //! Effects: Returns a const_reverse_iterator pointing to the end //! of the reversed container. @@ -836,7 +836,7 @@ class bstree_impl //! Complexity: Constant. //! //! Throws: Nothing. - const_reverse_iterator rend() const; + const_reverse_iterator rend() const BOOST_NOEXCEPT; //! Effects: Returns a const_reverse_iterator pointing to the end //! of the reversed container. @@ -844,28 +844,28 @@ class bstree_impl //! Complexity: Constant. //! //! Throws: Nothing. - const_reverse_iterator crend() const; + const_reverse_iterator crend() const BOOST_NOEXCEPT; //! Effects: Returns a iterator pointing to the root node of the container or end() if not present. //! //! Complexity: Constant. //! //! Throws: Nothing. - iterator root(); + iterator root() BOOST_NOEXCEPT; //! Effects: Returns a const_iterator pointing to the root node of the container or cend() if not present. //! //! Complexity: Constant. //! //! Throws: Nothing. - const_iterator root() const; + const_iterator root() const BOOST_NOEXCEPT; //! Effects: Returns a const_iterator pointing to the root node of the container or cend() if not present. //! //! Complexity: Constant. //! //! Throws: Nothing. - const_iterator croot() const; + const_iterator croot() const BOOST_NOEXCEPT; #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED @@ -877,7 +877,7 @@ class bstree_impl //! Throws: Nothing. //! //! Complexity: Constant. - static bstree_impl &container_from_end_iterator(iterator end_iterator) + static bstree_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast (data_type::get_tree_base_from_end_iterator(end_iterator)); @@ -891,7 +891,7 @@ class bstree_impl //! Throws: Nothing. //! //! Complexity: Constant. - static const bstree_impl &container_from_end_iterator(const_iterator end_iterator) + static const bstree_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast (data_type::get_tree_base_from_end_iterator(end_iterator)); @@ -905,7 +905,7 @@ class bstree_impl //! Throws: Nothing. //! //! Complexity: Logarithmic. - static bstree_impl &container_from_iterator(iterator it) + static bstree_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT { return container_from_end_iterator(it.end_iterator_from_it()); } //! Precondition: it must be a valid end const_iterator @@ -916,7 +916,7 @@ class bstree_impl //! Throws: Nothing. //! //! Complexity: Logarithmic. - static const bstree_impl &container_from_iterator(const_iterator it) + static const bstree_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return container_from_end_iterator(it.end_iterator_from_it()); } #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED @@ -942,7 +942,7 @@ class bstree_impl //! Complexity: Constant. //! //! Throws: Nothing. - bool empty() const + bool empty() const BOOST_NOEXCEPT { if(ConstantTimeSize){ return !this->data_type::sz_traits().get_size(); @@ -958,9 +958,9 @@ class bstree_impl //! if constant-time size option is disabled. Constant time otherwise. //! //! Throws: Nothing. - size_type size() const + size_type size() const BOOST_NOEXCEPT { - if(constant_time_size) + BOOST_IF_CONSTEXPR(constant_time_size) return this->sz_traits().get_size(); else{ return (size_type)node_algorithms::size(this->header_ptr()); @@ -1103,7 +1103,7 @@ class bstree_impl //! size of the range. However, it is linear in N if the range is already sorted //! by value_comp(). //! - //! Throws: Nothing. + //! Throws: If the comparison functor call throws. //! //! Note: Does not affect the validity of iterators and references. //! No copy-constructors are called. @@ -1123,7 +1123,7 @@ class bstree_impl //! Complexity: Average complexity for insert element is at //! most logarithmic. //! - //! Throws: Nothing. + //! Throws: If the comparison functor call throws. //! //! Note: Does not affect the validity of iterators and references. //! No copy-constructors are called. @@ -1149,7 +1149,7 @@ class bstree_impl //! constant time (two comparisons in the worst case) //! if t is inserted immediately before hint. //! - //! Throws: Nothing. + //! Throws: If the comparison functor call throws. //! //! Note: Does not affect the validity of iterators and references. //! No copy-constructors are called. @@ -1172,7 +1172,7 @@ class bstree_impl //! size of the range. However, it is linear in N if the range is already sorted //! by value_comp(). //! - //! Throws: Nothing. + //! Throws: If the comparison functor call throws. //! //! Note: Does not affect the validity of iterators and references. //! No copy-constructors are called. @@ -1312,7 +1312,7 @@ class bstree_impl //! Notes: This function has only sense if a "insert_check" has been //! previously executed to fill "commit_data". No value should be inserted or //! erased between the "insert_check" and "insert_commit" calls. - iterator insert_unique_commit(reference value, const insert_commit_data &commit_data) + iterator insert_unique_commit(reference value, const insert_commit_data &commit_data) BOOST_NOEXCEPT { node_ptr to_insert(this->get_value_traits().to_node_ptr(value)); BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::unique(to_insert)); @@ -1349,7 +1349,7 @@ class bstree_impl //! the successor of "value" container ordering invariant will be broken. //! This is a low-level function to be used only for performance reasons //! by advanced users. - iterator insert_before(const_iterator pos, reference value) + iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT { node_ptr to_insert(this->get_value_traits().to_node_ptr(value)); BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::unique(to_insert)); @@ -1372,7 +1372,7 @@ class bstree_impl //! This function is slightly more efficient than using "insert_before". //! This is a low-level function to be used only for performance reasons //! by advanced users. - void push_back(reference value) + void push_back(reference value) BOOST_NOEXCEPT { node_ptr to_insert(this->get_value_traits().to_node_ptr(value)); BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::unique(to_insert)); @@ -1394,7 +1394,7 @@ class bstree_impl //! This function is slightly more efficient than using "insert_before". //! This is a low-level function to be used only for performance reasons //! by advanced users. - void push_front(reference value) + void push_front(reference value) BOOST_NOEXCEPT { node_ptr to_insert(this->get_value_traits().to_node_ptr(value)); BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::unique(to_insert)); @@ -1410,7 +1410,7 @@ class bstree_impl //! //! Note: Invalidates the iterators (but not the references) //! to the erased elements. No destructors are called. - iterator erase(const_iterator i) + iterator erase(const_iterator i) BOOST_NOEXCEPT { const_iterator ret(i); ++ret; @@ -1418,7 +1418,7 @@ class bstree_impl BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || !node_algorithms::unique(to_erase)); node_algorithms::erase(this->header_ptr(), to_erase); this->sz_traits().decrement(); - if(safemode_or_autounlink) + BOOST_IF_CONSTEXPR(safemode_or_autounlink) node_algorithms::init(to_erase); return ret.unconst(); } @@ -1432,7 +1432,7 @@ class bstree_impl //! //! Note: Invalidates the iterators (but not the references) //! to the erased elements. No destructors are called. - iterator erase(const_iterator b, const_iterator e) + iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT { size_type n; return this->private_erase(b, e, n); } //! Effects: Erases all the elements with the given value. @@ -1445,7 +1445,7 @@ class bstree_impl //! //! Note: Invalidates the iterators (but not the references) //! to the erased elements. No destructors are called. - size_type erase(const key_type &key) + size_type erase(const key_type &key) BOOST_NOEXCEPT { return this->erase(key, this->key_comp()); } //! Requires: key is a value such that `*this` is partitioned with respect to @@ -1486,7 +1486,7 @@ class bstree_impl //! Note: Invalidates the iterators //! to the erased elements. template - iterator erase_and_dispose(const_iterator i, Disposer disposer) + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT { node_ptr to_erase(i.pointed_node()); iterator ret(this->erase(i)); @@ -1529,7 +1529,7 @@ class bstree_impl //! Note: Invalidates the iterators //! to the erased elements. template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT { size_type n; return this->private_erase(b, e, n, disposer); } //! Requires: key is a value such that `*this` is partitioned with respect to @@ -1570,9 +1570,9 @@ class bstree_impl //! //! Note: Invalidates the iterators (but not the references) //! to the erased elements. No destructors are called. - void clear() + void clear() BOOST_NOEXCEPT { - if(safemode_or_autounlink){ + BOOST_IF_CONSTEXPR(safemode_or_autounlink){ this->clear_and_dispose(detail::null_disposer()); } else{ @@ -1591,7 +1591,7 @@ class bstree_impl //! Note: Invalidates the iterators (but not the references) //! to the erased elements. Calls N times to disposer functor. template - void clear_and_dispose(Disposer disposer) + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT { node_algorithms::clear_and_dispose(this->header_ptr() , detail::node_disposer(disposer, &this->get_value_traits())); @@ -1834,7 +1834,7 @@ class bstree_impl //! //! Note: This static function is available only if the value traits //! is stateless. - static iterator s_iterator_to(reference value); + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT; //! Requires: value must be an lvalue and shall be in a set of //! appropriate type. Otherwise the behavior is undefined. @@ -1848,7 +1848,7 @@ class bstree_impl //! //! Note: This static function is available only if the value traits //! is stateless. - static const_iterator s_iterator_to(const_reference value); + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT; //! Requires: value must be an lvalue and shall be in a set of //! appropriate type. Otherwise the behavior is undefined. @@ -1859,7 +1859,7 @@ class bstree_impl //! Complexity: Constant. //! //! Throws: Nothing. - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! Requires: value must be an lvalue and shall be in a set of //! appropriate type. Otherwise the behavior is undefined. @@ -1870,7 +1870,7 @@ class bstree_impl //! Complexity: Constant. //! //! Throws: Nothing. - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! Requires: value shall not be in a container. //! @@ -1883,7 +1883,7 @@ class bstree_impl //! //! Note: This function puts the hook in the well-known default state //! used by auto_unlink and safe hooks. - static void init_node(reference value); + static void init_node(reference value) BOOST_NOEXCEPT; #endif //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) @@ -1897,14 +1897,14 @@ class bstree_impl //! only be used for more unlink_leftmost_without_rebalance calls. //! This function is normally used to achieve a step by step //! controlled destruction of the container. - pointer unlink_leftmost_without_rebalance() + pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT { node_ptr to_be_disposed(node_algorithms::unlink_leftmost_without_rebalance (this->header_ptr())); if(!to_be_disposed) return 0; this->sz_traits().decrement(); - if(safemode_or_autounlink)//If this is commented does not work with normal_link + BOOST_IF_CONSTEXPR(safemode_or_autounlink)//If this is commented does not work with normal_link node_algorithms::init(to_be_disposed); return this->get_value_traits().to_value_ptr(to_be_disposed); } @@ -1925,14 +1925,14 @@ class bstree_impl //! with_this is not equivalent to *replace_this according to the //! ordering rules. This function is faster than erasing and inserting //! the node, since no rebalancing or comparison is needed. - void replace_node(iterator replace_this, reference with_this); + void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT; //! Effects: Rebalances the tree. //! //! Throws: Nothing. //! //! Complexity: Linear. - void rebalance(); + void rebalance() BOOST_NOEXCEPT; //! Requires: old_root is a node of a tree. //! @@ -1943,7 +1943,7 @@ class bstree_impl //! Throws: Nothing. //! //! Complexity: Linear to the elements in the subtree. - iterator rebalance_subtree(iterator root); + iterator rebalance_subtree(iterator root) BOOST_NOEXCEPT; #endif //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) @@ -1959,12 +1959,12 @@ class bstree_impl //! If the user calls //! this function with a constant time size container or stateful comparison //! functor a compilation error will be issued. - static void remove_node(reference value) + static void remove_node(reference value) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT((!constant_time_size)); node_ptr to_remove(value_traits::to_node_ptr(value)); node_algorithms::unlink(to_remove); - if(safemode_or_autounlink) + BOOST_IF_CONSTEXPR(safemode_or_autounlink) node_algorithms::init(to_remove); } @@ -2216,16 +2216,16 @@ class bstree BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(bstree) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static bstree &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static bstree &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const bstree &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const bstree &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static bstree &container_from_iterator(iterator it) + BOOST_INTRUSIVE_FORCEINLINE static bstree &container_from_iterator(iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } - BOOST_INTRUSIVE_FORCEINLINE static const bstree &container_from_iterator(const_iterator it) + BOOST_INTRUSIVE_FORCEINLINE static const bstree &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } }; diff --git a/include/boost/intrusive/bstree_algorithms.hpp b/include/boost/intrusive/bstree_algorithms.hpp index e85e964..b51c5b0 100644 --- a/include/boost/intrusive/bstree_algorithms.hpp +++ b/include/boost/intrusive/bstree_algorithms.hpp @@ -212,7 +212,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_INTRUSIVE_FORCEINLINE static node_ptr begin_node(const const_node_ptr & header) BOOST_NOEXCEPT { return node_traits::get_left(header); } //! Requires: 'header' is the header node of a tree. @@ -222,7 +222,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_INTRUSIVE_FORCEINLINE static node_ptr end_node(const const_node_ptr & header) BOOST_NOEXCEPT { return detail::uncast(header); } //! Requires: 'header' is the header node of a tree. @@ -246,7 +246,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_INTRUSIVE_FORCEINLINE static bool unique(const const_node_ptr & node) BOOST_NOEXCEPT { return !NodeTraits::get_parent(node); } #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) @@ -275,7 +275,7 @@ class bstree_algorithms : public bstree_algorithms_base //! node1 and node2 are not equivalent according to the ordering rules. //! //!Experimental function - static void swap_nodes(node_ptr node1, node_ptr node2) + static void swap_nodes(node_ptr node1, node_ptr node2) BOOST_NOEXCEPT { if(node1 == node2) return; @@ -299,7 +299,7 @@ class bstree_algorithms : public bstree_algorithms_base //! node1 and node2 are not equivalent according to the ordering rules. //! //!Experimental function - static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2) + static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2) BOOST_NOEXCEPT { if(node1 == node2) return; @@ -446,7 +446,7 @@ class bstree_algorithms : public bstree_algorithms_base //! new_node is not equivalent to node_to_be_replaced according to the //! ordering rules. This function is faster than erasing and inserting //! the node, since no rebalancing and comparison is needed. Experimental function - BOOST_INTRUSIVE_FORCEINLINE static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node) + BOOST_INTRUSIVE_FORCEINLINE static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node) BOOST_NOEXCEPT { if(node_to_be_replaced == new_node) return; @@ -467,7 +467,7 @@ class bstree_algorithms : public bstree_algorithms_base //! new_node is not equivalent to node_to_be_replaced according to the //! ordering rules. This function is faster than erasing and inserting //! the node, since no rebalancing or comparison is needed. Experimental function - static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node) + static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node) BOOST_NOEXCEPT { if(node_to_be_replaced == new_node) return; @@ -518,7 +518,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Average constant time. //! //! Throws: Nothing. - static node_ptr next_node(const node_ptr & node); + static node_ptr next_node(const node_ptr & node) BOOST_NOEXCEPT; //! Requires: 'node' is a node from the tree except the leftmost node. //! @@ -527,7 +527,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Average constant time. //! //! Throws: Nothing. - static node_ptr prev_node(const node_ptr & node); + static node_ptr prev_node(const node_ptr & node) BOOST_NOEXCEPT; //! Requires: 'node' is a node of a tree but not the header. //! @@ -557,7 +557,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Throws: Nothing. //! //! Nodes: If node is inserted in a tree, this function corrupts the tree. - BOOST_INTRUSIVE_FORCEINLINE static void init(node_ptr node) + BOOST_INTRUSIVE_FORCEINLINE static void init(node_ptr node) BOOST_NOEXCEPT { NodeTraits::set_parent(node, node_ptr()); NodeTraits::set_left(node, node_ptr()); @@ -586,7 +586,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Throws: Nothing. //! //! Nodes: If node is inserted in a tree, this function corrupts the tree. - BOOST_INTRUSIVE_FORCEINLINE static void init_header(node_ptr header) + BOOST_INTRUSIVE_FORCEINLINE static void init_header(node_ptr header) BOOST_NOEXCEPT { NodeTraits::set_parent(header, node_ptr()); NodeTraits::set_left(header, header); @@ -603,9 +603,9 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Linear to the number of element of the source tree plus the. //! number of elements of tree target tree when calling this function. //! - //! Throws: If cloner functor throws. If this happens target nodes are disposed. + //! Throws: Nothing. template - static void clear_and_dispose(const node_ptr & header, Disposer disposer) + static void clear_and_dispose(const node_ptr & header, Disposer disposer) BOOST_NOEXCEPT { node_ptr source_root = NodeTraits::get_parent(header); if(!source_root) @@ -627,7 +627,7 @@ class bstree_algorithms : public bstree_algorithms_base //! only be used for more unlink_leftmost_without_rebalance calls. //! This function is normally used to achieve a step by step //! controlled destruction of the tree. - static node_ptr unlink_leftmost_without_rebalance(node_ptr header) + static node_ptr unlink_leftmost_without_rebalance(node_ptr header) BOOST_NOEXCEPT { node_ptr leftmost = NodeTraits::get_left(header); if (leftmost == header) @@ -664,7 +664,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Linear time. //! //! Throws: Nothing. - static std::size_t size(const const_node_ptr & header) + static std::size_t size(const const_node_ptr & header) BOOST_NOEXCEPT { node_ptr beg(begin_node(header)); node_ptr end(end_node(header)); @@ -682,7 +682,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Constant. //! //! Throws: Nothing. - static void swap_tree(node_ptr header1, node_ptr header2) + static void swap_tree(node_ptr header1, node_ptr header2) BOOST_NOEXCEPT { if(header1 == header2) return; @@ -730,7 +730,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Constant. //! //! Throws: Nothing. - static bool is_header(const const_node_ptr & p); + static bool is_header(const const_node_ptr & p) BOOST_NOEXCEPT; #endif //! Requires: "header" must be the header node of a tree. @@ -954,7 +954,7 @@ class bstree_algorithms : public bstree_algorithms_base //! previously executed to fill "commit_data". No value should be inserted or //! erased between the "insert_check" and "insert_commit" calls. BOOST_INTRUSIVE_FORCEINLINE static void insert_unique_commit - (node_ptr header, node_ptr new_value, const insert_commit_data &commit_data) + (node_ptr header, node_ptr new_value, const insert_commit_data &commit_data) BOOST_NOEXCEPT { return insert_commit(header, new_value, commit_data); } //! Requires: "header" must be the header node of a tree. @@ -1194,7 +1194,7 @@ class bstree_algorithms : public bstree_algorithms_base #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED , std::size_t *pdepth = 0 #endif - ) + ) BOOST_NOEXCEPT { insert_commit_data commit_data; insert_before_check(header, pos, commit_data, pdepth); @@ -1220,7 +1220,7 @@ class bstree_algorithms : public bstree_algorithms_base #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED , std::size_t *pdepth = 0 #endif - ) + ) BOOST_NOEXCEPT { insert_commit_data commit_data; push_back_check(header, commit_data, pdepth); @@ -1245,7 +1245,7 @@ class bstree_algorithms : public bstree_algorithms_base #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED , std::size_t *pdepth = 0 #endif - ) + ) BOOST_NOEXCEPT { insert_commit_data commit_data; push_front_check(header, commit_data, pdepth); @@ -1261,7 +1261,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Logarithmic to the number of nodes in the tree. //! //! Throws: Nothing. - static std::size_t depth(const_node_ptr node) + static std::size_t depth(const_node_ptr node) BOOST_NOEXCEPT { std::size_t depth = 0; node_ptr p_parent; @@ -1315,7 +1315,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Amortized constant time. //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static void erase(node_ptr header, node_ptr z) + BOOST_INTRUSIVE_FORCEINLINE static void erase(node_ptr header, node_ptr z) BOOST_NOEXCEPT { data_for_rebalance ignored; erase(header, z, ignored); @@ -1365,7 +1365,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Average complexity is constant time. //! //! Throws: Nothing. - static void unlink(node_ptr node) + static void unlink(node_ptr node) BOOST_NOEXCEPT { node_ptr x = NodeTraits::get_parent(node); if(x){ @@ -1382,7 +1382,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Throws: Nothing. //! //! Complexity: Linear. - static void rebalance(node_ptr header) + static void rebalance(node_ptr header) BOOST_NOEXCEPT { node_ptr root = NodeTraits::get_parent(header); if(root){ @@ -1399,7 +1399,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Throws: Nothing. //! //! Complexity: Linear. - static node_ptr rebalance_subtree(node_ptr old_root) + static node_ptr rebalance_subtree(node_ptr old_root) BOOST_NOEXCEPT { //Taken from: //"Tree rebalancing in optimal time and space" @@ -1585,7 +1585,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Linear time. //! //! Throws: Nothing. - static std::size_t subtree_size(const const_node_ptr & subtree) + static std::size_t subtree_size(const const_node_ptr & subtree) BOOST_NOEXCEPT { std::size_t count = 0; if (subtree){ @@ -1628,7 +1628,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_INTRUSIVE_FORCEINLINE static bool is_left_child(const node_ptr & p) BOOST_NOEXCEPT { return NodeTraits::get_left(NodeTraits::get_parent(p)) == p; } //! Requires: p is a node of a tree. @@ -1638,7 +1638,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_INTRUSIVE_FORCEINLINE static bool is_right_child(const node_ptr & p) BOOST_NOEXCEPT { return NodeTraits::get_right(NodeTraits::get_parent(p)) == p; } static void insert_before_check @@ -1665,7 +1665,7 @@ class bstree_algorithms : public bstree_algorithms_base #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED , std::size_t *pdepth = 0 #endif - ) + ) BOOST_NOEXCEPT { node_ptr prev(NodeTraits::get_right(header)); if(pdepth){ @@ -1680,7 +1680,7 @@ class bstree_algorithms : public bstree_algorithms_base #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED , std::size_t *pdepth = 0 #endif - ) + ) BOOST_NOEXCEPT { node_ptr pos(NodeTraits::get_left(header)); if(pdepth){ @@ -1758,7 +1758,7 @@ class bstree_algorithms : public bstree_algorithms_base } static void insert_commit - (node_ptr header, node_ptr new_node, const insert_commit_data &commit_data) + (node_ptr header, node_ptr new_node, const insert_commit_data &commit_data) BOOST_NOEXCEPT { //Check if commit_data has not been initialized by a insert_unique_check call. BOOST_INTRUSIVE_INVARIANT_ASSERT(commit_data.node != node_ptr()); @@ -1784,7 +1784,7 @@ class bstree_algorithms : public bstree_algorithms_base } //Fix header and own's parent data when replacing x with own, providing own's old data with parent - static void set_child(node_ptr header, node_ptr new_child, node_ptr new_parent, const bool link_left) + static void set_child(node_ptr header, node_ptr new_child, node_ptr new_parent, const bool link_left) BOOST_NOEXCEPT { if(new_parent == header) NodeTraits::set_parent(header, new_child); @@ -1795,7 +1795,7 @@ class bstree_algorithms : public bstree_algorithms_base } // rotate p to left (no header and p's parent fixup) - static void rotate_left_no_parent_fix(node_ptr p, node_ptr p_right) + static void rotate_left_no_parent_fix(node_ptr p, node_ptr p_right) BOOST_NOEXCEPT { node_ptr p_right_left(NodeTraits::get_left(p_right)); NodeTraits::set_right(p, p_right_left); @@ -1807,7 +1807,7 @@ class bstree_algorithms : public bstree_algorithms_base } // rotate p to left (with header and p's parent fixup) - static void rotate_left(node_ptr p, node_ptr p_right, node_ptr p_parent, node_ptr header) + static void rotate_left(node_ptr p, node_ptr p_right, node_ptr p_parent, node_ptr header) BOOST_NOEXCEPT { const bool p_was_left(NodeTraits::get_left(p_parent) == p); rotate_left_no_parent_fix(p, p_right); @@ -1816,7 +1816,7 @@ class bstree_algorithms : public bstree_algorithms_base } // rotate p to right (no header and p's parent fixup) - static void rotate_right_no_parent_fix(node_ptr p, node_ptr p_left) + static void rotate_right_no_parent_fix(node_ptr p, node_ptr p_left) BOOST_NOEXCEPT { node_ptr p_left_right(NodeTraits::get_right(p_left)); NodeTraits::set_left(p, p_left_right); @@ -1828,7 +1828,7 @@ class bstree_algorithms : public bstree_algorithms_base } // rotate p to right (with header and p's parent fixup) - static void rotate_right(node_ptr p, node_ptr p_left, node_ptr p_parent, node_ptr header) + static void rotate_right(node_ptr p, node_ptr p_left, node_ptr p_parent, node_ptr header) BOOST_NOEXCEPT { const bool p_was_left(NodeTraits::get_left(p_parent) == p); rotate_right_no_parent_fix(p, p_left); @@ -1838,7 +1838,7 @@ class bstree_algorithms : public bstree_algorithms_base private: - static void subtree_to_vine(node_ptr vine_tail, std::size_t &size) + static void subtree_to_vine(node_ptr vine_tail, std::size_t &size) BOOST_NOEXCEPT { //Inspired by LibAVL: //It uses a clever optimization for trees with parent pointers. @@ -1865,7 +1865,7 @@ class bstree_algorithms : public bstree_algorithms_base size = len; } - static void compress_subtree(node_ptr scanner, std::size_t count) + static void compress_subtree(node_ptr scanner, std::size_t count) BOOST_NOEXCEPT { while(count--){ //compress "count" spine nodes in the tree with pseudo-root scanner node_ptr child = NodeTraits::get_right(scanner); @@ -1882,7 +1882,7 @@ class bstree_algorithms : public bstree_algorithms_base } } - static void vine_to_subtree(node_ptr super_root, std::size_t count) + static void vine_to_subtree(node_ptr super_root, std::size_t count) BOOST_NOEXCEPT { const std::size_t one_szt = 1u; std::size_t leaf_nodes = count + one_szt - std::size_t(one_szt << detail::floor_log2(count + one_szt)); @@ -1909,7 +1909,7 @@ class bstree_algorithms : public bstree_algorithms_base //! Complexity: Logarithmic. //! //! Throws: Nothing. - static node_ptr get_root(const node_ptr & node) + static node_ptr get_root(const node_ptr & node) BOOST_NOEXCEPT { BOOST_INTRUSIVE_INVARIANT_ASSERT((!inited(node))); node_ptr x = NodeTraits::get_parent(node); @@ -2001,7 +2001,7 @@ class bstree_algorithms : public bstree_algorithms_base } template - static void dispose_subtree(node_ptr x, Disposer disposer) + static void dispose_subtree(node_ptr x, Disposer disposer) BOOST_NOEXCEPT { while (x){ node_ptr save(NodeTraits::get_left(x)); diff --git a/include/boost/intrusive/circular_list_algorithms.hpp b/include/boost/intrusive/circular_list_algorithms.hpp index e5d4175..1611a20 100644 --- a/include/boost/intrusive/circular_list_algorithms.hpp +++ b/include/boost/intrusive/circular_list_algorithms.hpp @@ -67,7 +67,7 @@ class circular_list_algorithms //! Complexity: Constant //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static void init(node_ptr this_node) + BOOST_INTRUSIVE_FORCEINLINE static void init(node_ptr this_node) BOOST_NOEXCEPT { const node_ptr null_node = node_ptr(); NodeTraits::set_next(this_node, null_node); @@ -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_INTRUSIVE_FORCEINLINE static bool inited(const const_node_ptr &this_node) BOOST_NOEXCEPT { return !NodeTraits::get_next(this_node); } //! Effects: Constructs an empty list, making this_node the only @@ -91,13 +91,12 @@ class circular_list_algorithms //! Complexity: Constant //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static void init_header(node_ptr this_node) + BOOST_INTRUSIVE_FORCEINLINE static void init_header(node_ptr this_node) BOOST_NOEXCEPT { NodeTraits::set_next(this_node, this_node); NodeTraits::set_previous(this_node, this_node); } - //! Requires: this_node must be in a circular list or be an empty circular list. //! //! Effects: Returns true is "this_node" is the only node of a circular list: @@ -106,7 +105,7 @@ class circular_list_algorithms //! Complexity: Constant //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static bool unique(const const_node_ptr &this_node) + BOOST_INTRUSIVE_FORCEINLINE static bool unique(const const_node_ptr &this_node) BOOST_NOEXCEPT { node_ptr next = NodeTraits::get_next(this_node); return !next || next == this_node; @@ -120,7 +119,7 @@ class circular_list_algorithms //! Complexity: Linear //! //! Throws: Nothing. - static std::size_t count(const const_node_ptr &this_node) + static std::size_t count(const const_node_ptr &this_node) BOOST_NOEXCEPT { std::size_t result = 0; const_node_ptr p = this_node; @@ -138,7 +137,7 @@ class circular_list_algorithms //! Complexity: Constant //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static node_ptr unlink(node_ptr this_node) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr unlink(node_ptr this_node) BOOST_NOEXCEPT { node_ptr next(NodeTraits::get_next(this_node)); node_ptr prev(NodeTraits::get_previous(this_node)); @@ -154,7 +153,7 @@ class circular_list_algorithms //! Complexity: Constant //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static void unlink(node_ptr b, node_ptr e) + BOOST_INTRUSIVE_FORCEINLINE static void unlink(node_ptr b, node_ptr e) BOOST_NOEXCEPT { if (b != e) { node_ptr prevb(NodeTraits::get_previous(b)); @@ -170,7 +169,7 @@ class circular_list_algorithms //! Complexity: Constant //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static void link_before(node_ptr nxt_node, node_ptr this_node) + BOOST_INTRUSIVE_FORCEINLINE static void link_before(node_ptr nxt_node, node_ptr this_node) BOOST_NOEXCEPT { node_ptr prev(NodeTraits::get_previous(nxt_node)); NodeTraits::set_previous(this_node, prev); @@ -189,7 +188,7 @@ class circular_list_algorithms //! Complexity: Constant //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static void link_after(node_ptr prev_node, node_ptr this_node) + BOOST_INTRUSIVE_FORCEINLINE static void link_after(node_ptr prev_node, node_ptr this_node) BOOST_NOEXCEPT { node_ptr next(NodeTraits::get_next(prev_node)); NodeTraits::set_previous(this_node, prev_node); @@ -211,7 +210,7 @@ class circular_list_algorithms //! Complexity: Constant //! //! Throws: Nothing. - static void swap_nodes(node_ptr this_node, node_ptr other_node) + static void swap_nodes(node_ptr this_node, node_ptr other_node) BOOST_NOEXCEPT { if (other_node == this_node) return; @@ -252,7 +251,7 @@ class circular_list_algorithms //! Complexity: Constant //! //! Throws: Nothing. - static void transfer(node_ptr p, node_ptr b, node_ptr e) + static void transfer(node_ptr p, node_ptr b, node_ptr e) BOOST_NOEXCEPT { if (b != e) { node_ptr prev_p(NodeTraits::get_previous(p)); @@ -277,7 +276,7 @@ class circular_list_algorithms //! Complexity: Constant //! //! Throws: Nothing. - static void transfer(node_ptr p, node_ptr i) + static void transfer(node_ptr p, node_ptr i) BOOST_NOEXCEPT { node_ptr n(NodeTraits::get_next(i)); if(n != p && i != p){ @@ -298,7 +297,7 @@ class circular_list_algorithms //! Throws: Nothing. //! //! Complexity: This function is linear time. - static void reverse(node_ptr p) + static void reverse(node_ptr p) BOOST_NOEXCEPT { node_ptr f(NodeTraits::get_next(p)); node_ptr i(NodeTraits::get_next(f)), e(p); @@ -316,7 +315,7 @@ class circular_list_algorithms //! Throws: Nothing. //! //! Complexity: Linear to the number of moved positions. - static void move_backwards(node_ptr p, std::size_t n) + static void move_backwards(node_ptr p, std::size_t n) BOOST_NOEXCEPT { //Null shift, nothing to do if(!n) return; @@ -336,7 +335,7 @@ class circular_list_algorithms //! Throws: Nothing. //! //! Complexity: Linear to the number of moved positions. - static void move_forward(node_ptr p, std::size_t n) + static void move_forward(node_ptr p, std::size_t n) BOOST_NOEXCEPT { //Null shift, nothing to do if(!n) return; @@ -359,7 +358,7 @@ class circular_list_algorithms //! Complexity: Linear //! //! Throws: Nothing. - static std::size_t distance(const const_node_ptr &f, const const_node_ptr &l) + static std::size_t distance(const const_node_ptr &f, const const_node_ptr &l) BOOST_NOEXCEPT { const_node_ptr i(f); std::size_t result = 0; @@ -435,14 +434,14 @@ class circular_list_algorithms } private: - BOOST_INTRUSIVE_FORCEINLINE static void swap_prev(node_ptr this_node, node_ptr other_node) + BOOST_INTRUSIVE_FORCEINLINE static void swap_prev(node_ptr this_node, node_ptr other_node) BOOST_NOEXCEPT { node_ptr temp(NodeTraits::get_previous(this_node)); NodeTraits::set_previous(this_node, NodeTraits::get_previous(other_node)); NodeTraits::set_previous(other_node, temp); } - BOOST_INTRUSIVE_FORCEINLINE static void swap_next(node_ptr this_node, node_ptr other_node) + BOOST_INTRUSIVE_FORCEINLINE static void swap_next(node_ptr this_node, node_ptr other_node) BOOST_NOEXCEPT { node_ptr temp(NodeTraits::get_next(this_node)); NodeTraits::set_next(this_node, NodeTraits::get_next(other_node)); diff --git a/include/boost/intrusive/circular_slist_algorithms.hpp b/include/boost/intrusive/circular_slist_algorithms.hpp index bc5b481..8c0bc8b 100644 --- a/include/boost/intrusive/circular_slist_algorithms.hpp +++ b/include/boost/intrusive/circular_slist_algorithms.hpp @@ -72,7 +72,7 @@ class circular_slist_algorithms //! Complexity: Constant //! //! Throws: Nothing. - static void init(node_ptr this_node); + static void init(node_ptr this_node) BOOST_NOEXCEPT; //! Requires: this_node must be in a circular list or be an empty circular list. //! @@ -83,7 +83,7 @@ class circular_slist_algorithms //! Complexity: Constant //! //! Throws: Nothing. - static bool unique(const_node_ptr this_node); + static bool unique(const_node_ptr this_node) BOOST_NOEXCEPT; //! Effects: Returns true is "this_node" has the same state as //! if it was inited using "init(node_ptr)" @@ -91,7 +91,7 @@ class circular_slist_algorithms //! Complexity: Constant //! //! Throws: Nothing. - static bool inited(const_node_ptr this_node); + static bool inited(const_node_ptr this_node) BOOST_NOEXCEPT; //! Requires: prev_node must be in a circular list or be an empty circular list. //! @@ -100,7 +100,7 @@ class circular_slist_algorithms //! Complexity: Constant //! //! Throws: Nothing. - static void unlink_after(node_ptr prev_node); + 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. @@ -110,7 +110,7 @@ class circular_slist_algorithms //! Complexity: Constant //! //! Throws: Nothing. - static void unlink_after(node_ptr prev_node, node_ptr last_node); + static void unlink_after(node_ptr prev_node, node_ptr last_node) BOOST_NOEXCEPT; //! Requires: prev_node must be a node of a circular list. //! @@ -119,7 +119,7 @@ class circular_slist_algorithms //! Complexity: Constant //! //! Throws: Nothing. - static void link_after(node_ptr prev_node, node_ptr this_node); + static void link_after(node_ptr prev_node, node_ptr this_node) BOOST_NOEXCEPT; //! Requires: b and e must be nodes of the same circular list or an empty range. //! and p must be a node of a different circular list. @@ -130,7 +130,7 @@ class circular_slist_algorithms //! Complexity: Constant //! //! Throws: Nothing. - static void transfer_after(node_ptr p, node_ptr b, node_ptr e); + static void transfer_after(node_ptr p, node_ptr b, node_ptr e) BOOST_NOEXCEPT; #endif //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) @@ -141,7 +141,7 @@ class circular_slist_algorithms //! Complexity: Constant //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static void init_header(node_ptr this_node) + BOOST_INTRUSIVE_FORCEINLINE static void init_header(node_ptr this_node) BOOST_NOEXCEPT { NodeTraits::set_next(this_node, this_node); } //! Requires: this_node and prev_init_node must be in the same circular list. @@ -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_INTRUSIVE_FORCEINLINE static node_ptr get_previous_node(const node_ptr &prev_init_node, const 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_INTRUSIVE_FORCEINLINE static node_ptr get_previous_node(const 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_INTRUSIVE_FORCEINLINE static node_ptr get_previous_previous_node(const 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) + static node_ptr get_previous_previous_node(node_ptr p, const 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) + static std::size_t count(const const_node_ptr & this_node) BOOST_NOEXCEPT { std::size_t result = 0; const_node_ptr p = this_node; @@ -223,7 +223,7 @@ class circular_slist_algorithms //! Complexity: Linear to the number of elements in the circular list //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static void unlink(node_ptr this_node) + BOOST_INTRUSIVE_FORCEINLINE static void unlink(node_ptr this_node) BOOST_NOEXCEPT { if(NodeTraits::get_next(this_node)) base_t::unlink_after(get_previous_node(this_node)); @@ -236,7 +236,7 @@ class circular_slist_algorithms //! Complexity: Linear to the number of elements in the circular list. //! //! Throws: Nothing. - BOOST_INTRUSIVE_FORCEINLINE static void link_before (node_ptr nxt_node, node_ptr this_node) + BOOST_INTRUSIVE_FORCEINLINE static void link_before (node_ptr nxt_node, node_ptr this_node) BOOST_NOEXCEPT { base_t::link_after(get_previous_node(nxt_node), this_node); } //! Requires: this_node and other_node must be nodes inserted @@ -249,7 +249,7 @@ class circular_slist_algorithms //! Complexity: Linear to number of elements of both lists //! //! Throws: Nothing. - static void swap_nodes(node_ptr this_node, node_ptr other_node) + static void swap_nodes(node_ptr this_node, node_ptr other_node) BOOST_NOEXCEPT { if (other_node == this_node) return; @@ -275,7 +275,7 @@ class circular_slist_algorithms //! Throws: Nothing. //! //! Complexity: This function is linear to the contained elements. - static void reverse(node_ptr p) + static void reverse(node_ptr p) BOOST_NOEXCEPT { node_ptr i = NodeTraits::get_next(p), e(p); for (;;) { @@ -294,7 +294,7 @@ class circular_slist_algorithms //! Throws: Nothing. //! //! Complexity: Linear to the number of elements plus the number moved positions. - static node_ptr move_backwards(node_ptr p, std::size_t n) + static node_ptr move_backwards(node_ptr p, std::size_t n) BOOST_NOEXCEPT { //Null shift, nothing to do if(!n) return node_ptr(); @@ -346,7 +346,7 @@ class circular_slist_algorithms //! Throws: Nothing. //! //! Complexity: Linear to the number of elements plus the number moved positions. - static node_ptr move_forward(node_ptr p, std::size_t n) + static node_ptr move_forward(node_ptr p, std::size_t n) BOOST_NOEXCEPT { //Null shift, nothing to do if(!n) return node_ptr(); diff --git a/include/boost/intrusive/derivation_value_traits.hpp b/include/boost/intrusive/derivation_value_traits.hpp index 223b983..d3eb100 100644 --- a/include/boost/intrusive/derivation_value_traits.hpp +++ b/include/boost/intrusive/derivation_value_traits.hpp @@ -52,18 +52,18 @@ struct derivation_value_traits pointer_traits::reference const_reference; static const link_mode_type link_mode = LinkMode; - static node_ptr to_node_ptr(reference value) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr to_node_ptr(reference value) BOOST_NOEXCEPT { return node_ptr(&value); } - static const_node_ptr to_node_ptr(const_reference value) + BOOST_INTRUSIVE_FORCEINLINE static const_node_ptr to_node_ptr(const_reference value) BOOST_NOEXCEPT { return node_ptr(&value); } - static pointer to_value_ptr(const node_ptr &n) + BOOST_INTRUSIVE_FORCEINLINE static pointer to_value_ptr(const node_ptr &n) BOOST_NOEXCEPT { return pointer_traits::pointer_to(static_cast(*n)); } - static const_pointer to_value_ptr(const const_node_ptr &n) + BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const 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 f044918..1dbcbd7 100644 --- a/include/boost/intrusive/detail/any_node_and_algorithms.hpp +++ b/include/boost/intrusive/detail/any_node_and_algorithms.hpp @@ -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_INTRUSIVE_FORCEINLINE static void init(const 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) @@ -263,7 +263,7 @@ class any_algorithms BOOST_INTRUSIVE_FORCEINLINE static bool inited(const const_node_ptr & node) { return !node->node_ptr_1; }; - BOOST_INTRUSIVE_FORCEINLINE static bool unique(const const_node_ptr & node) + BOOST_INTRUSIVE_FORCEINLINE static bool unique(const const_node_ptr & node) BOOST_NOEXCEPT { return !node->node_ptr_1; } static void unlink(const node_ptr &) diff --git a/include/boost/intrusive/detail/bstree_algorithms_base.hpp b/include/boost/intrusive/detail/bstree_algorithms_base.hpp index 8f0efef..f8d8dfc 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) + static node_ptr next_node(const 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) + static node_ptr prev_node(const 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) + static bool is_header(const const_node_ptr & p) BOOST_NOEXCEPT { node_ptr p_left (NodeTraits::get_left(p)); node_ptr p_right(NodeTraits::get_right(p)); diff --git a/include/boost/intrusive/detail/common_slist_algorithms.hpp b/include/boost/intrusive/detail/common_slist_algorithms.hpp index 88f3fed..521ba33 100644 --- a/include/boost/intrusive/detail/common_slist_algorithms.hpp +++ b/include/boost/intrusive/detail/common_slist_algorithms.hpp @@ -52,7 +52,7 @@ class common_slist_algorithms return p; } - BOOST_INTRUSIVE_FORCEINLINE static void init(node_ptr this_node) + BOOST_INTRUSIVE_FORCEINLINE static void init(node_ptr this_node) BOOST_NOEXCEPT { NodeTraits::set_next(this_node, node_ptr()); } BOOST_INTRUSIVE_FORCEINLINE static bool unique(const const_node_ptr & this_node) @@ -64,16 +64,16 @@ class common_slist_algorithms BOOST_INTRUSIVE_FORCEINLINE static bool inited(const const_node_ptr & this_node) { return !NodeTraits::get_next(this_node); } - BOOST_INTRUSIVE_FORCEINLINE static void unlink_after(node_ptr prev_node) + BOOST_INTRUSIVE_FORCEINLINE static void unlink_after(node_ptr prev_node) BOOST_NOEXCEPT { const_node_ptr this_node(NodeTraits::get_next(prev_node)); NodeTraits::set_next(prev_node, NodeTraits::get_next(this_node)); } - BOOST_INTRUSIVE_FORCEINLINE static void unlink_after(node_ptr prev_node, node_ptr last_node) + BOOST_INTRUSIVE_FORCEINLINE static void unlink_after(node_ptr prev_node, node_ptr last_node) BOOST_NOEXCEPT { NodeTraits::set_next(prev_node, last_node); } - BOOST_INTRUSIVE_FORCEINLINE static void link_after(node_ptr prev_node, node_ptr this_node) + BOOST_INTRUSIVE_FORCEINLINE static void link_after(node_ptr prev_node, node_ptr this_node) BOOST_NOEXCEPT { NodeTraits::set_next(this_node, NodeTraits::get_next(prev_node)); NodeTraits::set_next(prev_node, this_node); @@ -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) + static std::size_t distance(const const_node_ptr &f, const const_node_ptr &l) BOOST_NOEXCEPT { const_node_ptr i(f); std::size_t result = 0; diff --git a/include/boost/intrusive/detail/generic_hook.hpp b/include/boost/intrusive/detail/generic_hook.hpp index a4921de..6e43f90 100644 --- a/include/boost/intrusive/detail/generic_hook.hpp +++ b/include/boost/intrusive/detail/generic_hook.hpp @@ -161,30 +161,30 @@ class generic_hook < NodeTraits , Tag, LinkMode, BaseHookType> hooktags; - BOOST_INTRUSIVE_FORCEINLINE node_ptr this_ptr() + BOOST_INTRUSIVE_FORCEINLINE node_ptr this_ptr() BOOST_NOEXCEPT { return pointer_traits::pointer_to(static_cast(*this)); } - BOOST_INTRUSIVE_FORCEINLINE const_node_ptr this_ptr() const + BOOST_INTRUSIVE_FORCEINLINE const_node_ptr this_ptr() const BOOST_NOEXCEPT { return pointer_traits::pointer_to(static_cast(*this)); } public: /// @endcond - BOOST_INTRUSIVE_FORCEINLINE generic_hook() + BOOST_INTRUSIVE_FORCEINLINE generic_hook() BOOST_NOEXCEPT { if(hooktags::safemode_or_autounlink){ node_algorithms::init(this->this_ptr()); } } - BOOST_INTRUSIVE_FORCEINLINE generic_hook(const generic_hook& ) + BOOST_INTRUSIVE_FORCEINLINE generic_hook(const generic_hook& ) BOOST_NOEXCEPT { if(hooktags::safemode_or_autounlink){ node_algorithms::init(this->this_ptr()); } } - BOOST_INTRUSIVE_FORCEINLINE generic_hook& operator=(const generic_hook& ) + BOOST_INTRUSIVE_FORCEINLINE generic_hook& operator=(const generic_hook& ) BOOST_NOEXCEPT { return *this; } BOOST_INTRUSIVE_FORCEINLINE ~generic_hook() @@ -193,20 +193,20 @@ class generic_hook (*this, detail::link_dispatch()); } - BOOST_INTRUSIVE_FORCEINLINE void swap_nodes(generic_hook &other) + BOOST_INTRUSIVE_FORCEINLINE void swap_nodes(generic_hook &other) BOOST_NOEXCEPT { node_algorithms::swap_nodes (this->this_ptr(), other.this_ptr()); } - BOOST_INTRUSIVE_FORCEINLINE bool is_linked() const + BOOST_INTRUSIVE_FORCEINLINE bool is_linked() const BOOST_NOEXCEPT { //is_linked() can be only used in safe-mode or auto-unlink BOOST_STATIC_ASSERT(( hooktags::safemode_or_autounlink )); return !node_algorithms::unique(this->this_ptr()); } - BOOST_INTRUSIVE_FORCEINLINE void unlink() + BOOST_INTRUSIVE_FORCEINLINE void unlink() BOOST_NOEXCEPT { BOOST_STATIC_ASSERT(( (int)hooktags::link_mode == (int)auto_unlink )); node_ptr n(this->this_ptr()); diff --git a/include/boost/intrusive/detail/hashtable_node.hpp b/include/boost/intrusive/detail/hashtable_node.hpp index 913c38d..b1ed68c 100644 --- a/include/boost/intrusive/detail/hashtable_node.hpp +++ b/include/boost/intrusive/detail/hashtable_node.hpp @@ -101,7 +101,7 @@ struct bucket_traits_impl BOOST_INTRUSIVE_FORCEINLINE const bucket_ptr &bucket_begin() const { return buckets_; } - BOOST_INTRUSIVE_FORCEINLINE size_type bucket_count() const + BOOST_INTRUSIVE_FORCEINLINE size_type bucket_count() const BOOST_NOEXCEPT { return buckets_len_; } private: diff --git a/include/boost/intrusive/detail/node_cloner_disposer.hpp b/include/boost/intrusive/detail/node_cloner_disposer.hpp index 8ed3c4d..edd1270 100644 --- a/include/boost/intrusive/detail/node_cloner_disposer.hpp +++ b/include/boost/intrusive/detail/node_cloner_disposer.hpp @@ -91,7 +91,7 @@ struct node_disposer BOOST_INTRUSIVE_FORCEINLINE void operator()(const node_ptr & p) { - if(safemode_or_autounlink) + BOOST_IF_CONSTEXPR(safemode_or_autounlink) node_algorithms::init(p); base_t::get()(traits_->to_value_ptr(p)); } diff --git a/include/boost/intrusive/hashtable.hpp b/include/boost/intrusive/hashtable.hpp index b0e9517..f3d331e 100644 --- a/include/boost/intrusive/hashtable.hpp +++ b/include/boost/intrusive/hashtable.hpp @@ -732,10 +732,10 @@ struct bucket_plus_vtraits { return this->data.bucket_traits_; } //bucket operations - BOOST_INTRUSIVE_FORCEINLINE bucket_ptr priv_bucket_pointer() const + BOOST_INTRUSIVE_FORCEINLINE bucket_ptr priv_bucket_pointer() const BOOST_NOEXCEPT { return this->priv_bucket_traits().bucket_begin(); } - std::size_t priv_bucket_count() const + std::size_t priv_bucket_count() const BOOST_NOEXCEPT { return this->priv_bucket_traits().bucket_count(); } BOOST_INTRUSIVE_FORCEINLINE bucket_ptr priv_invalid_bucket() const @@ -966,7 +966,7 @@ struct bucket_plus_vtraits { bucket_ptr buckets_it = buckets_ptr; for(std::size_t bucket_i = 0; bucket_i != bucket_cnt; ++buckets_it, ++bucket_i){ - if(safemode_or_autounlink){ + BOOST_IF_CONSTEXPR(safemode_or_autounlink){ buckets_it->clear_and_dispose(detail::init_disposer()); } else{ @@ -981,13 +981,13 @@ struct bucket_plus_vtraits typedef hashtable_iterator iterator; typedef hashtable_iterator const_iterator; - BOOST_INTRUSIVE_FORCEINLINE iterator end() + BOOST_INTRUSIVE_FORCEINLINE iterator end() BOOST_NOEXCEPT { return iterator(this->priv_invalid_local_it(), 0); } - BOOST_INTRUSIVE_FORCEINLINE const_iterator end() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator end() const BOOST_NOEXCEPT { return this->cend(); } - BOOST_INTRUSIVE_FORCEINLINE const_iterator cend() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator cend() const BOOST_NOEXCEPT { return const_iterator(this->priv_invalid_local_it(), 0); } //Public functions: @@ -1467,18 +1467,18 @@ struct hashdata_internal { return bucket_plus_vtraits::priv_stored_hash(n, false_value); } //public functions - BOOST_INTRUSIVE_FORCEINLINE SizeType split_count() const + BOOST_INTRUSIVE_FORCEINLINE SizeType split_count() const BOOST_NOEXCEPT { return this->priv_split_traits().get_size(); } - BOOST_INTRUSIVE_FORCEINLINE iterator iterator_to(reference value) + BOOST_INTRUSIVE_FORCEINLINE iterator iterator_to(reference value) BOOST_NOEXCEPT { return iterator(bucket_type::s_iterator_to (this->priv_value_to_node(value)), &this->get_bucket_value_traits()); } - const_iterator iterator_to(const_reference value) const + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT { siterator const sit = bucket_type::s_iterator_to ( *pointer_traits::const_cast_from @@ -1487,14 +1487,14 @@ struct hashdata_internal return const_iterator(sit, &this->get_bucket_value_traits()); } - static local_iterator s_local_iterator_to(reference value) + static local_iterator s_local_iterator_to(reference value) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT((!stateful_value_traits)); siterator sit = bucket_type::s_iterator_to(*value_traits::to_node_ptr(value)); return local_iterator(sit, const_value_traits_ptr()); } - static const_local_iterator s_local_iterator_to(const_reference value) + static const_local_iterator s_local_iterator_to(const_reference value) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT((!stateful_value_traits)); siterator const sit = bucket_type::s_iterator_to @@ -1504,13 +1504,13 @@ struct hashdata_internal return const_local_iterator(sit, const_value_traits_ptr()); } - local_iterator local_iterator_to(reference value) + local_iterator local_iterator_to(reference value) BOOST_NOEXCEPT { siterator sit = bucket_type::s_iterator_to(this->priv_value_to_node(value)); return local_iterator(sit, this->priv_value_traits_ptr()); } - const_local_iterator local_iterator_to(const_reference value) const + const_local_iterator local_iterator_to(const_reference value) const BOOST_NOEXCEPT { siterator sit = bucket_type::s_iterator_to ( *pointer_traits::const_cast_from @@ -1519,36 +1519,36 @@ struct hashdata_internal return const_local_iterator(sit, this->priv_value_traits_ptr()); } - BOOST_INTRUSIVE_FORCEINLINE size_type bucket_count() const + BOOST_INTRUSIVE_FORCEINLINE size_type bucket_count() const BOOST_NOEXCEPT { const std::size_t bc = this->priv_bucket_count(); BOOST_INTRUSIVE_INVARIANT_ASSERT(sizeof(size_type) >= sizeof(std::size_t) || bc <= size_type(-1)); return static_cast(bc); } - BOOST_INTRUSIVE_FORCEINLINE size_type bucket_size(size_type n) const + BOOST_INTRUSIVE_FORCEINLINE size_type bucket_size(size_type n) const BOOST_NOEXCEPT { return this->priv_bucket_pointer()[n].size(); } - BOOST_INTRUSIVE_FORCEINLINE bucket_ptr bucket_pointer() const + BOOST_INTRUSIVE_FORCEINLINE bucket_ptr bucket_pointer() const BOOST_NOEXCEPT { return this->priv_bucket_pointer(); } - BOOST_INTRUSIVE_FORCEINLINE local_iterator begin(size_type n) + BOOST_INTRUSIVE_FORCEINLINE local_iterator begin(size_type n) BOOST_NOEXCEPT { return local_iterator(this->priv_bucket_pointer()[n].begin(), this->priv_value_traits_ptr()); } - BOOST_INTRUSIVE_FORCEINLINE const_local_iterator begin(size_type n) const + BOOST_INTRUSIVE_FORCEINLINE const_local_iterator begin(size_type n) const BOOST_NOEXCEPT { return this->cbegin(n); } - static BOOST_INTRUSIVE_FORCEINLINE size_type suggested_upper_bucket_count(size_type n) + static BOOST_INTRUSIVE_FORCEINLINE size_type suggested_upper_bucket_count(size_type n) BOOST_NOEXCEPT { return prime_list_holder<0>::suggested_upper_bucket_count(n); } - static BOOST_INTRUSIVE_FORCEINLINE size_type suggested_lower_bucket_count(size_type n) + static BOOST_INTRUSIVE_FORCEINLINE size_type suggested_lower_bucket_count(size_type n) BOOST_NOEXCEPT { return prime_list_holder<0>::suggested_lower_bucket_count(n); } - const_local_iterator cbegin(size_type n) const + const_local_iterator cbegin(size_type n) const BOOST_NOEXCEPT { return const_local_iterator ( pointer_traits::const_cast_from(this->priv_bucket_pointer())[n].begin() @@ -1558,13 +1558,13 @@ struct hashdata_internal using internal_type::end; using internal_type::cend; - local_iterator end(size_type n) + local_iterator end(size_type n) BOOST_NOEXCEPT { return local_iterator(this->priv_bucket_pointer()[n].end(), this->priv_value_traits_ptr()); } - BOOST_INTRUSIVE_FORCEINLINE const_local_iterator end(size_type n) const + BOOST_INTRUSIVE_FORCEINLINE const_local_iterator end(size_type n) const BOOST_NOEXCEPT { return this->cend(n); } - const_local_iterator cend(size_type n) const + const_local_iterator cend(size_type n) const BOOST_NOEXCEPT { return const_local_iterator ( pointer_traits::const_cast_from(this->priv_bucket_pointer())[n].end() @@ -1573,13 +1573,13 @@ struct hashdata_internal //Public functions for hashtable_impl - BOOST_INTRUSIVE_FORCEINLINE iterator begin() + BOOST_INTRUSIVE_FORCEINLINE iterator begin() BOOST_NOEXCEPT { return iterator(this->priv_begin(), &this->get_bucket_value_traits()); } - BOOST_INTRUSIVE_FORCEINLINE const_iterator begin() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator begin() const BOOST_NOEXCEPT { return this->cbegin(); } - BOOST_INTRUSIVE_FORCEINLINE const_iterator cbegin() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator cbegin() const BOOST_NOEXCEPT { return const_iterator(this->priv_begin(), &this->get_bucket_value_traits()); } BOOST_INTRUSIVE_FORCEINLINE hasher hash_function() const @@ -1904,7 +1904,7 @@ class hashtable_impl //! Worst case (empty unordered_set): O(this->bucket_count()) //! //! Throws: Nothing. - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! Effects: Returns a const_iterator pointing to the beginning //! of the unordered_set. @@ -1913,7 +1913,7 @@ class hashtable_impl //! Worst case (empty unordered_set): O(this->bucket_count()) //! //! Throws: Nothing. - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! Effects: Returns a const_iterator pointing to the beginning //! of the unordered_set. @@ -1922,28 +1922,28 @@ class hashtable_impl //! Worst case (empty unordered_set): O(this->bucket_count()) //! //! Throws: Nothing. - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! Effects: Returns an iterator pointing to the end of the unordered_set. //! //! Complexity: Constant. //! //! Throws: Nothing. - iterator end(); + iterator end() BOOST_NOEXCEPT; //! Effects: Returns a const_iterator pointing to the end of the unordered_set. //! //! Complexity: Constant. //! //! Throws: Nothing. - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! Effects: Returns a const_iterator pointing to the end of the unordered_set. //! //! Complexity: Constant. //! //! Throws: Nothing. - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! Effects: Returns the hasher object used by the unordered_set. //! @@ -1968,9 +1968,9 @@ class hashtable_impl //! Otherwise constant. //! //! Throws: Nothing. - bool empty() const + bool empty() const BOOST_NOEXCEPT { - if(constant_time_size){ + BOOST_IF_CONSTEXPR(constant_time_size){ return !this->size(); } else if(cache_begin){ @@ -1994,9 +1994,9 @@ class hashtable_impl //! constant_time_size is false. Constant-time otherwise. //! //! Throws: Nothing. - size_type size() const + size_type size() const BOOST_NOEXCEPT { - if(constant_time_size) + BOOST_IF_CONSTEXPR(constant_time_size) return this->priv_size_traits().get_size(); else{ size_type len = 0; @@ -2265,7 +2265,7 @@ class hashtable_impl //! erased between the "insert_check" and "insert_commit" calls. //! //! After a successful rehashing insert_commit_data remains valid. - iterator insert_unique_commit(reference value, const insert_commit_data &commit_data) + iterator insert_unique_commit(reference value, const insert_commit_data &commit_data) BOOST_NOEXCEPT { size_type bucket_num = this->priv_hash_to_bucket(commit_data.hash); bucket_type &b = this->priv_bucket_pointer()[bucket_num]; @@ -2286,7 +2286,7 @@ class hashtable_impl //! //! Note: Invalidates the iterators (but not the references) //! to the erased element. No destructors are called. - BOOST_INTRUSIVE_FORCEINLINE void erase(const_iterator i) + BOOST_INTRUSIVE_FORCEINLINE void erase(const_iterator i) BOOST_NOEXCEPT { this->erase_and_dispose(i, detail::null_disposer()); } //! Effects: Erases the range pointed to by b end e. @@ -2298,7 +2298,7 @@ class hashtable_impl //! //! Note: Invalidates the iterators (but not the references) //! to the erased elements. No destructors are called. - BOOST_INTRUSIVE_FORCEINLINE void erase(const_iterator b, const_iterator e) + BOOST_INTRUSIVE_FORCEINLINE void erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT { this->erase_and_dispose(b, e, detail::null_disposer()); } //! Effects: Erases all the elements with the given value. @@ -2354,7 +2354,7 @@ class hashtable_impl template BOOST_INTRUSIVE_DOC1ST(void , typename detail::disable_if_convertible::type) - erase_and_dispose(const_iterator i, Disposer disposer) + erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT { //Get the bucket number and local iterator for both iterators siterator const first_local_it(i.slist_it()); @@ -2377,7 +2377,7 @@ class hashtable_impl //! Note: Invalidates the iterators //! to the erased elements. template - void erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) + void erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT { if(b != e){ //Get the bucket number and local iterator for both iterators @@ -2485,7 +2485,7 @@ class hashtable_impl //! //! Note: Invalidates the iterators (but not the references) //! to the erased elements. No destructors are called. - void clear() + void clear() BOOST_NOEXCEPT { this->priv_clear_buckets_and_cache(); this->priv_size_traits().set_size(size_type(0)); @@ -2503,7 +2503,7 @@ class hashtable_impl //! Note: Invalidates the iterators (but not the references) //! to the erased elements. No destructors are called. template - void clear_and_dispose(Disposer disposer) + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT { if(!constant_time_size || !this->empty()){ size_type num_buckets = this->bucket_count(); @@ -2718,7 +2718,7 @@ class hashtable_impl //! Complexity: Constant. //! //! Throws: If the internal hash function throws. - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! Requires: value must be an lvalue and shall be in a unordered_set of //! appropriate type. Otherwise the behavior is undefined. @@ -2729,7 +2729,7 @@ class hashtable_impl //! Complexity: Constant. //! //! Throws: If the internal hash function throws. - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! Requires: value must be an lvalue and shall be in a unordered_set of //! appropriate type. Otherwise the behavior is undefined. @@ -2743,7 +2743,7 @@ class hashtable_impl //! //! Note: This static function is available only if the value traits //! is stateless. - static local_iterator s_local_iterator_to(reference value); + static local_iterator s_local_iterator_to(reference value) BOOST_NOEXCEPT; //! Requires: value must be an lvalue and shall be in a unordered_set of //! appropriate type. Otherwise the behavior is undefined. @@ -2757,7 +2757,7 @@ class hashtable_impl //! //! Note: This static function is available only if the value traits //! is stateless. - static const_local_iterator s_local_iterator_to(const_reference value); + static const_local_iterator s_local_iterator_to(const_reference value) BOOST_NOEXCEPT; //! Requires: value must be an lvalue and shall be in a unordered_set of //! appropriate type. Otherwise the behavior is undefined. @@ -2768,7 +2768,7 @@ class hashtable_impl //! Complexity: Constant. //! //! Throws: Nothing. - local_iterator local_iterator_to(reference value); + local_iterator local_iterator_to(reference value) BOOST_NOEXCEPT; //! Requires: value must be an lvalue and shall be in a unordered_set of //! appropriate type. Otherwise the behavior is undefined. @@ -2779,7 +2779,7 @@ class hashtable_impl //! Complexity: Constant. //! //! Throws: Nothing. - const_local_iterator local_iterator_to(const_reference value) const; + const_local_iterator local_iterator_to(const_reference value) const BOOST_NOEXCEPT; //! Effects: Returns the number of buckets passed in the constructor //! or the last rehash function. @@ -2787,7 +2787,7 @@ class hashtable_impl //! Complexity: Constant. //! //! Throws: Nothing. - size_type bucket_count() const; + size_type bucket_count() const BOOST_NOEXCEPT; //! Requires: n is in the range [0, this->bucket_count()). //! @@ -2796,7 +2796,7 @@ class hashtable_impl //! Complexity: Constant. //! //! Throws: Nothing. - size_type bucket_size(size_type n) const; + size_type bucket_size(size_type n) const BOOST_NOEXCEPT; #endif //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) //! Effects: Returns the index of the bucket in which elements @@ -2807,7 +2807,7 @@ class hashtable_impl //! Throws: If the hash functor throws. //! //! Note: the return value is in the range [0, this->bucket_count()). - BOOST_INTRUSIVE_FORCEINLINE size_type bucket(const key_type& k) const + BOOST_INTRUSIVE_FORCEINLINE size_type bucket(const key_type& k) const { return this->bucket(k, this->priv_hasher()); } //! Requires: "hash_func" must be a hash function that induces @@ -2833,7 +2833,7 @@ class hashtable_impl //! Complexity: Constant. //! //! Throws: Nothing. - bucket_ptr bucket_pointer() const; + bucket_ptr bucket_pointer() const BOOST_NOEXCEPT; //! Requires: n is in the range [0, this->bucket_count()). //! @@ -2846,7 +2846,7 @@ class hashtable_impl //! //! Note: [this->begin(n), this->end(n)) is a valid range //! containing all of the elements in the nth bucket. - local_iterator begin(size_type n); + local_iterator begin(size_type n) BOOST_NOEXCEPT; //! Requires: n is in the range [0, this->bucket_count()). //! @@ -2859,7 +2859,7 @@ class hashtable_impl //! //! Note: [this->begin(n), this->end(n)) is a valid range //! containing all of the elements in the nth bucket. - const_local_iterator begin(size_type n) const; + const_local_iterator begin(size_type n) const BOOST_NOEXCEPT; //! Requires: n is in the range [0, this->bucket_count()). //! @@ -2872,7 +2872,7 @@ class hashtable_impl //! //! Note: [this->begin(n), this->end(n)) is a valid range //! containing all of the elements in the nth bucket. - const_local_iterator cbegin(size_type n) const; + const_local_iterator cbegin(size_type n) const BOOST_NOEXCEPT; //! Requires: n is in the range [0, this->bucket_count()). //! @@ -2885,7 +2885,7 @@ class hashtable_impl //! //! Note: [this->begin(n), this->end(n)) is a valid range //! containing all of the elements in the nth bucket. - local_iterator end(size_type n); + local_iterator end(size_type n) BOOST_NOEXCEPT; //! Requires: n is in the range [0, this->bucket_count()). //! @@ -2898,7 +2898,7 @@ class hashtable_impl //! //! Note: [this->begin(n), this->end(n)) is a valid range //! containing all of the elements in the nth bucket. - const_local_iterator end(size_type n) const; + const_local_iterator end(size_type n) const BOOST_NOEXCEPT; //! Requires: n is in the range [0, this->bucket_count()). //! @@ -2911,7 +2911,7 @@ class hashtable_impl //! //! Note: [this->begin(n), this->end(n)) is a valid range //! containing all of the elements in the nth bucket. - const_local_iterator cend(size_type n) const; + const_local_iterator cend(size_type n) const BOOST_NOEXCEPT; #endif //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) //! Requires: new_bucket_traits can hold a pointer to a new bucket array @@ -3039,7 +3039,7 @@ class hashtable_impl //! Throws: Nothing //! //! Note: this method is only available if incremental option is activated. - bool incremental_rehash(const bucket_traits &new_bucket_traits) + bool incremental_rehash(const bucket_traits &new_bucket_traits) BOOST_NOEXCEPT { //This function is only available for containers with incremental hashing BOOST_STATIC_ASSERT(( incremental && power_2_buckets )); @@ -3085,7 +3085,7 @@ class hashtable_impl //! Complexity: Constant //! //! Throws: Nothing - size_type split_count() const; + size_type split_count() const BOOST_NOEXCEPT; //! Effects: Returns the nearest new bucket count optimized for //! the container that is bigger or equal than n. This suggestion can be @@ -3096,7 +3096,7 @@ class hashtable_impl //! Complexity: Amortized constant time. //! //! Throws: Nothing. - static size_type suggested_upper_bucket_count(size_type n); + static size_type suggested_upper_bucket_count(size_type n) BOOST_NOEXCEPT; //! Effects: Returns the nearest new bucket count optimized for //! the container that is smaller or equal than n. This suggestion can be @@ -3107,7 +3107,7 @@ class hashtable_impl //! Complexity: Amortized constant time. //! //! Throws: Nothing. - static size_type suggested_lower_bucket_count(size_type n); + static size_type suggested_lower_bucket_count(size_type n) BOOST_NOEXCEPT; #endif //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) @@ -3396,7 +3396,7 @@ class hashtable_impl } //return previous iterator to the next equal range group in case - static siterator priv_last_in_group(const siterator &it_first_in_group) + static siterator priv_last_in_group(const siterator &it_first_in_group) BOOST_NOEXCEPT { return bucket_type::s_iterator_to (*group_functions_t::get_last_in_group @@ -3497,19 +3497,19 @@ class hashtable_impl return to_return; } - std::size_t priv_get_bucket_num(siterator it) + std::size_t priv_get_bucket_num(siterator it) BOOST_NOEXCEPT { return this->priv_get_bucket_num_hash_dispatch(it, store_hash_t()); } - std::size_t priv_get_bucket_num_hash_dispatch(siterator it, detail::true_) //store_hash + std::size_t priv_get_bucket_num_hash_dispatch(siterator it, detail::true_) BOOST_NOEXCEPT //store_hash { return this->priv_hash_to_bucket (this->priv_stored_hash(it.pointed_node(), store_hash_t())); } - std::size_t priv_get_bucket_num_hash_dispatch(siterator it, detail::false_) //NO store_hash + std::size_t priv_get_bucket_num_hash_dispatch(siterator it, detail::false_) BOOST_NOEXCEPT //NO store_hash { return this->priv_get_bucket_num_no_hash_store(it, optimize_multikey_t()); } - static siterator priv_get_previous(bucket_type &b, siterator i) + static siterator priv_get_previous(bucket_type &b, siterator i) BOOST_NOEXCEPT { return bucket_plus_vtraits_t::priv_get_previous(b, i, optimize_multikey_t()); } /// @endcond diff --git a/include/boost/intrusive/linear_slist_algorithms.hpp b/include/boost/intrusive/linear_slist_algorithms.hpp index 55eb9e8..2ed6cbe 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); + static void init(const node_ptr & this_node) BOOST_NOEXCEPT; //! Requires: this_node must be in a circular list or be an empty circular list. //! @@ -89,7 +89,7 @@ class linear_slist_algorithms //! Complexity: Constant //! //! Throws: Nothing. - static bool unique(const_node_ptr this_node); + static bool unique(const_node_ptr this_node) BOOST_NOEXCEPT; //! Effects: Returns true is "this_node" has the same state as if //! it was inited using "init(node_ptr)" @@ -97,7 +97,7 @@ class linear_slist_algorithms //! Complexity: Constant //! //! Throws: Nothing. - static bool inited(const_node_ptr this_node); + static bool inited(const_node_ptr this_node) BOOST_NOEXCEPT; //! Requires: prev_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); + static void unlink_after(const 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); + static void unlink_after(const node_ptr & prev_node, const 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); + static void link_after(const node_ptr & prev_node, const 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); + static void transfer_after(const node_ptr & p, const node_ptr & b, const 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_INTRUSIVE_FORCEINLINE static void init_header(const 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. @@ -159,7 +159,8 @@ class linear_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_INTRUSIVE_FORCEINLINE static node_ptr + get_previous_node(const node_ptr & prev_init_node, const 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. @@ -170,7 +171,7 @@ class linear_slist_algorithms //! Complexity: Linear //! //! Throws: Nothing. - static std::size_t count(const const_node_ptr & this_node) + static std::size_t count(const const_node_ptr & this_node) BOOST_NOEXCEPT { std::size_t result = 0; const_node_ptr p = this_node; @@ -190,7 +191,7 @@ class linear_slist_algorithms //! Complexity: Constant //! //! Throws: Nothing. - static void swap_trailing_nodes(node_ptr this_node, node_ptr other_node) + BOOST_INTRUSIVE_FORCEINLINE static void swap_trailing_nodes(node_ptr this_node, node_ptr other_node) BOOST_NOEXCEPT { node_ptr this_nxt = NodeTraits::get_next(this_node); node_ptr other_nxt = NodeTraits::get_next(other_node); @@ -205,7 +206,7 @@ class linear_slist_algorithms //! Throws: Nothing. //! //! Complexity: This function is linear to the contained elements. - static node_ptr reverse(node_ptr p) + static node_ptr reverse(node_ptr p) BOOST_NOEXCEPT { if(!p) return node_ptr(); node_ptr i = NodeTraits::get_next(p); @@ -228,7 +229,7 @@ class linear_slist_algorithms //! Throws: Nothing. //! //! Complexity: Linear to the number of elements plus the number moved positions. - static node_pair move_first_n_backwards(node_ptr p, std::size_t n) + static node_pair move_first_n_backwards(node_ptr p, std::size_t n) BOOST_NOEXCEPT { node_pair ret; //Null shift, or count() == 0 or 1, nothing to do @@ -283,7 +284,7 @@ class linear_slist_algorithms //! Throws: Nothing. //! //! Complexity: Linear to the number of elements plus the number moved positions. - static node_pair move_first_n_forward(node_ptr p, std::size_t n) + static node_pair move_first_n_forward(node_ptr p, std::size_t n) BOOST_NOEXCEPT { node_pair ret; //Null shift, or count() == 0 or 1, nothing to do diff --git a/include/boost/intrusive/list.hpp b/include/boost/intrusive/list.hpp index d924bdd..296997b 100644 --- a/include/boost/intrusive/list.hpp +++ b/include/boost/intrusive/list.hpp @@ -148,22 +148,22 @@ class list_impl root_plus_size root_plus_size_; } data_; - size_traits &priv_size_traits() + BOOST_INTRUSIVE_FORCEINLINE size_traits &priv_size_traits() BOOST_NOEXCEPT { return data_.root_plus_size_; } - const size_traits &priv_size_traits() const + BOOST_INTRUSIVE_FORCEINLINE const size_traits &priv_size_traits() const BOOST_NOEXCEPT { return data_.root_plus_size_; } - const value_traits &priv_value_traits() const + BOOST_INTRUSIVE_FORCEINLINE const value_traits &priv_value_traits() const BOOST_NOEXCEPT { return data_; } - value_traits &priv_value_traits() + BOOST_INTRUSIVE_FORCEINLINE value_traits &priv_value_traits() BOOST_NOEXCEPT { return data_; } typedef typename boost::intrusive::value_traits_pointers ::const_value_traits_ptr const_value_traits_ptr; - const_value_traits_ptr priv_value_traits_ptr() const + BOOST_INTRUSIVE_FORCEINLINE const_value_traits_ptr priv_value_traits_ptr() const BOOST_NOEXCEPT { return pointer_traits::pointer_to(this->priv_value_traits()); } /// @endcond @@ -245,11 +245,13 @@ class list_impl //! are called), but the hooks according to the ValueTraits template parameter //! are set to their default value. //! + //! Throws: Nothing. + //! //! Complexity: Linear to the number of elements in the list, if //! it's a safe-mode or auto-unlink value . Otherwise constant. ~list_impl() { - if(is_safe_autounlink::value){ + BOOST_IF_CONSTEXPR(is_safe_autounlink::value){ this->clear(); node_algorithms::init(this->get_root_node()); } @@ -265,7 +267,7 @@ class list_impl //! Complexity: Constant. //! //! Note: Does not affect the validity of iterators and references. - void push_back(reference value) + void push_back(reference value) BOOST_NOEXCEPT { node_ptr to_insert = priv_value_traits().to_node_ptr(value); BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::inited(to_insert)); @@ -283,7 +285,7 @@ class list_impl //! Complexity: Constant. //! //! Note: Does not affect the validity of iterators and references. - void push_front(reference value) + void push_front(reference value) BOOST_NOEXCEPT { node_ptr to_insert = priv_value_traits().to_node_ptr(value); BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::inited(to_insert)); @@ -299,7 +301,7 @@ class list_impl //! Complexity: Constant. //! //! Note: Invalidates the iterators (but not the references) to the erased element. - void pop_back() + void pop_back() BOOST_NOEXCEPT { return this->pop_back_and_dispose(detail::null_disposer()); } //! Requires: Disposer::operator()(pointer) shouldn't throw. @@ -314,12 +316,12 @@ class list_impl //! //! Note: Invalidates the iterators to the erased element. template - void pop_back_and_dispose(Disposer disposer) + void pop_back_and_dispose(Disposer disposer) BOOST_NOEXCEPT { node_ptr to_erase = node_traits::get_previous(this->get_root_node()); node_algorithms::unlink(to_erase); this->priv_size_traits().decrement(); - if(safemode_or_autounlink) + BOOST_IF_CONSTEXPR(safemode_or_autounlink) node_algorithms::init(to_erase); disposer(priv_value_traits().to_value_ptr(to_erase)); } @@ -332,7 +334,7 @@ class list_impl //! Complexity: Constant. //! //! Note: Invalidates the iterators (but not the references) to the erased element. - void pop_front() + void pop_front() BOOST_NOEXCEPT { return this->pop_front_and_dispose(detail::null_disposer()); } //! Requires: Disposer::operator()(pointer) shouldn't throw. @@ -347,12 +349,12 @@ class list_impl //! //! Note: Invalidates the iterators to the erased element. template - void pop_front_and_dispose(Disposer disposer) + void pop_front_and_dispose(Disposer disposer) BOOST_NOEXCEPT { node_ptr to_erase = node_traits::get_next(this->get_root_node()); node_algorithms::unlink(to_erase); this->priv_size_traits().decrement(); - if(safemode_or_autounlink) + BOOST_IF_CONSTEXPR(safemode_or_autounlink) node_algorithms::init(to_erase); disposer(priv_value_traits().to_value_ptr(to_erase)); } @@ -362,7 +364,7 @@ class list_impl //! Throws: Nothing. //! //! Complexity: Constant. - reference front() + BOOST_INTRUSIVE_FORCEINLINE reference front() BOOST_NOEXCEPT { return *priv_value_traits().to_value_ptr(node_traits::get_next(this->get_root_node())); } //! Effects: Returns a const_reference to the first element of the list. @@ -370,7 +372,7 @@ class list_impl //! Throws: Nothing. //! //! Complexity: Constant. - const_reference front() const + BOOST_INTRUSIVE_FORCEINLINE const_reference front() const BOOST_NOEXCEPT { return *priv_value_traits().to_value_ptr(node_traits::get_next(this->get_root_node())); } //! Effects: Returns a reference to the last element of the list. @@ -378,7 +380,7 @@ class list_impl //! Throws: Nothing. //! //! Complexity: Constant. - reference back() + BOOST_INTRUSIVE_FORCEINLINE reference back() BOOST_NOEXCEPT { return *priv_value_traits().to_value_ptr(node_traits::get_previous(this->get_root_node())); } //! Effects: Returns a const_reference to the last element of the list. @@ -386,7 +388,7 @@ class list_impl //! Throws: Nothing. //! //! Complexity: Constant. - const_reference back() const + BOOST_INTRUSIVE_FORCEINLINE const_reference back() const BOOST_NOEXCEPT { return *priv_value_traits().to_value_ptr(detail::uncast(node_traits::get_previous(this->get_root_node()))); } //! Effects: Returns an iterator to the first element contained in the list. @@ -394,7 +396,7 @@ class list_impl //! Throws: Nothing. //! //! Complexity: Constant. - iterator begin() + BOOST_INTRUSIVE_FORCEINLINE iterator begin() BOOST_NOEXCEPT { return iterator(node_traits::get_next(this->get_root_node()), this->priv_value_traits_ptr()); } //! Effects: Returns a const_iterator to the first element contained in the list. @@ -402,7 +404,7 @@ class list_impl //! Throws: Nothing. //! //! Complexity: Constant. - const_iterator begin() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator begin() const BOOST_NOEXCEPT { return this->cbegin(); } //! Effects: Returns a const_iterator to the first element contained in the list. @@ -410,7 +412,7 @@ class list_impl //! Throws: Nothing. //! //! Complexity: Constant. - const_iterator cbegin() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator cbegin() const BOOST_NOEXCEPT { return const_iterator(node_traits::get_next(this->get_root_node()), this->priv_value_traits_ptr()); } //! Effects: Returns an iterator to the end of the list. @@ -418,7 +420,7 @@ class list_impl //! Throws: Nothing. //! //! Complexity: Constant. - iterator end() + BOOST_INTRUSIVE_FORCEINLINE iterator end() BOOST_NOEXCEPT { return iterator(this->get_root_node(), this->priv_value_traits_ptr()); } //! Effects: Returns a const_iterator to the end of the list. @@ -426,7 +428,7 @@ class list_impl //! Throws: Nothing. //! //! Complexity: Constant. - const_iterator end() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator end() const BOOST_NOEXCEPT { return this->cend(); } //! Effects: Returns a constant iterator to the end of the list. @@ -434,7 +436,7 @@ class list_impl //! Throws: Nothing. //! //! Complexity: Constant. - const_iterator cend() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator cend() const BOOST_NOEXCEPT { return const_iterator(detail::uncast(this->get_root_node()), this->priv_value_traits_ptr()); } //! Effects: Returns a reverse_iterator pointing to the beginning @@ -443,7 +445,7 @@ class list_impl //! Throws: Nothing. //! //! Complexity: Constant. - reverse_iterator rbegin() + BOOST_INTRUSIVE_FORCEINLINE reverse_iterator rbegin() BOOST_NOEXCEPT { return reverse_iterator(this->end()); } //! Effects: Returns a const_reverse_iterator pointing to the beginning @@ -452,7 +454,7 @@ class list_impl //! Throws: Nothing. //! //! Complexity: Constant. - const_reverse_iterator rbegin() const + BOOST_INTRUSIVE_FORCEINLINE const_reverse_iterator rbegin() const BOOST_NOEXCEPT { return this->crbegin(); } //! Effects: Returns a const_reverse_iterator pointing to the beginning @@ -461,7 +463,7 @@ class list_impl //! Throws: Nothing. //! //! Complexity: Constant. - const_reverse_iterator crbegin() const + BOOST_INTRUSIVE_FORCEINLINE const_reverse_iterator crbegin() const BOOST_NOEXCEPT { return const_reverse_iterator(end()); } //! Effects: Returns a reverse_iterator pointing to the end @@ -470,7 +472,7 @@ class list_impl //! Throws: Nothing. //! //! Complexity: Constant. - reverse_iterator rend() + BOOST_INTRUSIVE_FORCEINLINE reverse_iterator rend() BOOST_NOEXCEPT { return reverse_iterator(begin()); } //! Effects: Returns a const_reverse_iterator pointing to the end @@ -479,7 +481,7 @@ class list_impl //! Throws: Nothing. //! //! Complexity: Constant. - const_reverse_iterator rend() const + BOOST_INTRUSIVE_FORCEINLINE const_reverse_iterator rend() const BOOST_NOEXCEPT { return this->crend(); } //! Effects: Returns a const_reverse_iterator pointing to the end @@ -488,7 +490,7 @@ class list_impl //! Throws: Nothing. //! //! Complexity: Constant. - const_reverse_iterator crend() const + BOOST_INTRUSIVE_FORCEINLINE const_reverse_iterator crend() const BOOST_NOEXCEPT { return const_reverse_iterator(this->begin()); } //! Precondition: end_iterator must be a valid end iterator @@ -499,7 +501,7 @@ class list_impl //! Throws: Nothing. //! //! Complexity: Constant. - static list_impl &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static list_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return list_impl::priv_container_from_end_iterator(end_iterator); } //! Precondition: end_iterator must be a valid end const_iterator @@ -510,7 +512,7 @@ class list_impl //! Throws: Nothing. //! //! Complexity: Constant. - static const list_impl &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const list_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return list_impl::priv_container_from_end_iterator(end_iterator); } //! Effects: Returns the number of the elements contained in the list. @@ -521,9 +523,9 @@ class list_impl //! if constant-time size option is disabled. Constant time otherwise. //! //! Note: Does not affect the validity of iterators and references. - size_type size() const + BOOST_INTRUSIVE_FORCEINLINE size_type size() const BOOST_NOEXCEPT { - if(constant_time_size) + BOOST_IF_CONSTEXPR(constant_time_size) return this->priv_size_traits().get_size(); else return node_algorithms::count(this->get_root_node()) - 1; @@ -536,7 +538,7 @@ class list_impl //! Complexity: Constant. //! //! Note: Does not affect the validity of iterators and references. - bool empty() const + BOOST_INTRUSIVE_FORCEINLINE bool empty() const BOOST_NOEXCEPT { return node_algorithms::unique(this->get_root_node()); } //! Effects: Swaps the elements of x and *this. @@ -546,7 +548,7 @@ class list_impl //! Complexity: Constant. //! //! Note: Does not affect the validity of iterators and references. - void swap(list_impl& other) + BOOST_INTRUSIVE_FORCEINLINE void swap(list_impl& other) BOOST_NOEXCEPT { node_algorithms::swap_nodes(this->get_root_node(), other.get_root_node()); this->priv_size_traits().swap(other.priv_size_traits()); @@ -561,7 +563,7 @@ class list_impl //! Complexity: Linear to the number of shifts. //! //! Note: Does not affect the validity of iterators and references. - void shift_backwards(size_type n = 1) + BOOST_INTRUSIVE_FORCEINLINE void shift_backwards(size_type n = 1) BOOST_NOEXCEPT { node_algorithms::move_forward(this->get_root_node(), n); } //! Effects: Moves forward all the elements, so that the second @@ -573,7 +575,7 @@ class list_impl //! Complexity: Linear to the number of shifts. //! //! Note: Does not affect the validity of iterators and references. - void shift_forward(size_type n = 1) + BOOST_INTRUSIVE_FORCEINLINE void shift_forward(size_type n = 1) BOOST_NOEXCEPT { node_algorithms::move_backwards(this->get_root_node(), n); } //! Effects: Erases the element pointed by i of the list. @@ -588,7 +590,7 @@ class list_impl //! //! Note: Invalidates the iterators (but not the references) to the //! erased element. - iterator erase(const_iterator i) + BOOST_INTRUSIVE_FORCEINLINE iterator erase(const_iterator i) BOOST_NOEXCEPT { return this->erase_and_dispose(i, detail::null_disposer()); } //! Requires: b and e must be valid iterators to elements in *this. @@ -606,9 +608,9 @@ class list_impl //! //! Note: Invalidates the iterators (but not the references) to the //! erased elements. - iterator erase(const_iterator b, const_iterator e) + BOOST_INTRUSIVE_FORCEINLINE iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT { - if(safemode_or_autounlink || constant_time_size){ + BOOST_IF_CONSTEXPR(safemode_or_autounlink || constant_time_size){ return this->erase_and_dispose(b, e, detail::null_disposer()); } else{ @@ -633,14 +635,14 @@ class list_impl //! //! Note: Invalidates the iterators (but not the references) to the //! erased elements. - iterator erase(const_iterator b, const_iterator e, size_type n) + 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); - if(safemode_or_autounlink || constant_time_size){ + BOOST_IF_CONSTEXPR(safemode_or_autounlink || constant_time_size){ return this->erase_and_dispose(b, e, detail::null_disposer()); } else{ - if(constant_time_size){ + BOOST_IF_CONSTEXPR(constant_time_size){ this->priv_size_traits().decrease(n); } node_algorithms::unlink(b.pointed_node(), e.pointed_node()); @@ -663,13 +665,13 @@ class list_impl //! //! Note: Invalidates the iterators to the erased element. template - iterator erase_and_dispose(const_iterator i, Disposer disposer) + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT { node_ptr to_erase(i.pointed_node()); ++i; node_algorithms::unlink(to_erase); this->priv_size_traits().decrement(); - if(safemode_or_autounlink) + BOOST_IF_CONSTEXPR(safemode_or_autounlink) node_algorithms::init(to_erase); disposer(this->priv_value_traits().to_value_ptr(to_erase)); return i.unconst(); @@ -677,7 +679,7 @@ class list_impl #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) template - iterator erase_and_dispose(iterator i, Disposer disposer) + iterator erase_and_dispose(iterator i, Disposer disposer) BOOST_NOEXCEPT { return this->erase_and_dispose(const_iterator(i), disposer); } #endif @@ -696,14 +698,14 @@ class list_impl //! //! Note: Invalidates the iterators to the erased elements. template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT { node_ptr bp(b.pointed_node()), ep(e.pointed_node()); node_algorithms::unlink(bp, ep); while(bp != ep){ node_ptr to_erase(bp); bp = node_traits::get_next(bp); - if(safemode_or_autounlink) + BOOST_IF_CONSTEXPR(safemode_or_autounlink) node_algorithms::init(to_erase); disposer(priv_value_traits().to_value_ptr(to_erase)); this->priv_size_traits().decrement(); @@ -720,9 +722,9 @@ class list_impl //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise. //! //! Note: Invalidates the iterators (but not the references) to the erased elements. - void clear() + void clear() BOOST_NOEXCEPT { - if(safemode_or_autounlink){ + BOOST_IF_CONSTEXPR(safemode_or_autounlink){ this->clear_and_dispose(detail::null_disposer()); } else{ @@ -743,13 +745,13 @@ class list_impl //! //! Note: Invalidates the iterators to the erased elements. template - void clear_and_dispose(Disposer disposer) + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT { const_iterator it(this->begin()), itend(this->end()); while(it != itend){ node_ptr to_erase(it.pointed_node()); ++it; - if(safemode_or_autounlink) + BOOST_IF_CONSTEXPR(safemode_or_autounlink) node_algorithms::init(to_erase); disposer(priv_value_traits().to_value_ptr(to_erase)); } @@ -822,7 +824,7 @@ class list_impl //! Complexity: Constant time. No copy constructors are called. //! //! Note: Does not affect the validity of iterators and references. - iterator insert(const_iterator p, reference value) + iterator insert(const_iterator p, reference value) BOOST_NOEXCEPT { node_ptr to_insert = this->priv_value_traits().to_node_ptr(value); BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::inited(to_insert)); @@ -843,7 +845,7 @@ class list_impl //! //! Note: Does not affect the validity of iterators and references. template - void insert(const_iterator p, Iterator b, Iterator e) + void insert(const_iterator p, Iterator b, Iterator e) BOOST_NOEXCEPT { for (; b != e; ++b) this->insert(p, *b); @@ -865,7 +867,7 @@ class list_impl //! Note: Invalidates the iterators (but not the references) //! to the erased elements. template - void assign(Iterator b, Iterator e) + void assign(Iterator b, Iterator e) BOOST_NOEXCEPT { this->clear(); this->insert(this->cend(), b, e); @@ -888,7 +890,7 @@ class list_impl //! Note: Invalidates the iterators (but not the references) //! to the erased elements. template - void dispose_and_assign(Disposer disposer, Iterator b, Iterator e) + void dispose_and_assign(Disposer disposer, Iterator b, Iterator e) BOOST_NOEXCEPT { this->clear_and_dispose(disposer); this->insert(this->cend(), b, e); @@ -905,7 +907,7 @@ class list_impl //! //! Note: Iterators of values obtained from list x now point to elements of //! this list. Iterators of this list and all the references are not invalidated. - void splice(const_iterator p, list_impl& x) + void splice(const_iterator p, list_impl& x) BOOST_NOEXCEPT { if(!x.empty()){ node_algorithms::transfer @@ -930,7 +932,7 @@ class list_impl //! //! Note: Iterators of values obtained from list x now point to elements of this //! list. Iterators of this list and all the references are not invalidated. - void splice(const_iterator p, list_impl&x, const_iterator new_ele) + void splice(const_iterator p, list_impl&x, const_iterator new_ele) BOOST_NOEXCEPT { node_algorithms::transfer(p.pointed_node(), new_ele.pointed_node()); x.priv_size_traits().decrement(); @@ -950,9 +952,9 @@ class list_impl //! //! Note: Iterators of values obtained from list x now point to elements of this //! list. Iterators of this list and all the references are not invalidated. - void splice(const_iterator p, list_impl&x, const_iterator f, const_iterator e) + void splice(const_iterator p, list_impl&x, const_iterator f, const_iterator e) BOOST_NOEXCEPT { - if(constant_time_size) + BOOST_IF_CONSTEXPR(constant_time_size) this->splice(p, x, f, e, node_algorithms::distance(f.pointed_node(), e.pointed_node())); else this->splice(p, x, f, e, 1);//intrusive::iterator_distance is a dummy value @@ -971,10 +973,10 @@ class list_impl //! //! Note: Iterators of values obtained from list x now point to elements of this //! list. Iterators of this list and all the references are not invalidated. - void splice(const_iterator p, list_impl&x, const_iterator f, const_iterator e, size_type n) + void splice(const_iterator p, list_impl&x, const_iterator f, const_iterator e, size_type n) BOOST_NOEXCEPT { if(n){ - if(constant_time_size){ + BOOST_IF_CONSTEXPR(constant_time_size){ BOOST_INTRUSIVE_INVARIANT_ASSERT(n == node_algorithms::distance(f.pointed_node(), e.pointed_node())); node_algorithms::transfer(p.pointed_node(), f.pointed_node(), e.pointed_node()); size_traits &thist = this->priv_size_traits(); @@ -1102,7 +1104,7 @@ class list_impl //! Complexity: This function is linear time. //! //! Note: Iterators and references are not invalidated - void reverse() + void reverse() BOOST_NOEXCEPT { node_algorithms::reverse(this->get_root_node()); } //! Effects: Removes all the elements that compare equal to value. @@ -1114,7 +1116,7 @@ class list_impl //! //! Note: The relative order of elements that are not removed is unchanged, //! and iterators to elements that are not removed remain valid. - void remove(const_reference value) + void remove(const_reference value) BOOST_NOEXCEPT { this->remove_if(value_equal(value)); } //! Requires: Disposer::operator()(pointer) shouldn't throw. @@ -1129,7 +1131,7 @@ class list_impl //! Note: The relative order of elements that are not removed is unchanged, //! and iterators to elements that are not removed remain valid. template - void remove_and_dispose(const_reference value, Disposer disposer) + void remove_and_dispose(const_reference value, Disposer disposer) BOOST_NOEXCEPT { this->remove_and_dispose_if(value_equal(value), disposer); } //! Effects: Removes all the elements for which a specified @@ -1267,7 +1269,7 @@ class list_impl //! Note: Iterators and references are not invalidated. //! This static function is available only if the value traits //! is stateless. - static iterator s_iterator_to(reference value) + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT((!stateful_value_traits)); BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(value_traits::to_node_ptr(value))); @@ -1285,7 +1287,7 @@ class list_impl //! Note: Iterators and references are not invalidated. //! This static function is available only if the value traits //! is stateless. - static const_iterator s_iterator_to(const_reference value) + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT((!stateful_value_traits)); reference r =*detail::uncast(pointer_traits::pointer_to(value)); @@ -1302,7 +1304,7 @@ class list_impl //! Complexity: Constant time. //! //! Note: Iterators and references are not invalidated. - iterator iterator_to(reference value) + iterator iterator_to(reference value) BOOST_NOEXCEPT { BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(this->priv_value_traits().to_node_ptr(value))); return iterator(this->priv_value_traits().to_node_ptr(value), this->priv_value_traits_ptr()); @@ -1317,7 +1319,7 @@ class list_impl //! Complexity: Constant time. //! //! Note: Iterators and references are not invalidated. - const_iterator iterator_to(const_reference value) const + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT { reference r = *detail::uncast(pointer_traits::pointer_to(value)); BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(this->priv_value_traits().to_node_ptr(r))); @@ -1341,7 +1343,7 @@ class list_impl == (node_traits::get_previous(header_ptr) == header_ptr)); if (node_traits::get_next(header_ptr) == header_ptr) { - if (constant_time_size) + BOOST_IF_CONSTEXPR(constant_time_size) BOOST_INTRUSIVE_INVARIANT_ASSERT(this->priv_size_traits().get_size() == 0); return; } @@ -1356,11 +1358,11 @@ class list_impl if (p == header_ptr) break; ++node_count; } - if (constant_time_size) + BOOST_IF_CONSTEXPR(constant_time_size) BOOST_INTRUSIVE_INVARIANT_ASSERT(this->priv_size_traits().get_size() == node_count); } - friend bool operator==(const list_impl &x, const list_impl &y) + BOOST_INTRUSIVE_FORCEINLINE friend bool operator==(const list_impl &x, const list_impl &y) { if(constant_time_size && x.size() != y.size()){ return false; @@ -1368,28 +1370,28 @@ class list_impl return ::boost::intrusive::algo_equal(x.cbegin(), x.cend(), y.cbegin(), y.cend()); } - friend bool operator!=(const list_impl &x, const list_impl &y) + BOOST_INTRUSIVE_FORCEINLINE friend bool operator!=(const list_impl &x, const list_impl &y) { return !(x == y); } - friend bool operator<(const list_impl &x, const list_impl &y) + BOOST_INTRUSIVE_FORCEINLINE friend bool operator<(const list_impl &x, const list_impl &y) { return ::boost::intrusive::algo_lexicographical_compare(x.begin(), x.end(), y.begin(), y.end()); } - friend bool operator>(const list_impl &x, const list_impl &y) + BOOST_INTRUSIVE_FORCEINLINE friend bool operator>(const list_impl &x, const list_impl &y) { return y < x; } - friend bool operator<=(const list_impl &x, const list_impl &y) + BOOST_INTRUSIVE_FORCEINLINE friend bool operator<=(const list_impl &x, const list_impl &y) { return !(y < x); } - friend bool operator>=(const list_impl &x, const list_impl &y) + BOOST_INTRUSIVE_FORCEINLINE friend bool operator>=(const list_impl &x, const list_impl &y) { return !(x < y); } - friend void swap(list_impl &x, list_impl &y) + BOOST_INTRUSIVE_FORCEINLINE friend void swap(list_impl &x, list_impl &y) BOOST_NOEXCEPT { x.swap(y); } /// @cond private: - static list_impl &priv_container_from_end_iterator(const const_iterator &end_iterator) + static list_impl &priv_container_from_end_iterator(const const_iterator &end_iterator) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT((has_container_from_iterator)); node_ptr p = end_iterator.pointed_node(); @@ -1499,10 +1501,10 @@ class list BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(list) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static list &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static list &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const list &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const list &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } }; diff --git a/include/boost/intrusive/list_hook.hpp b/include/boost/intrusive/list_hook.hpp index 892e4e2..03cf9a5 100644 --- a/include/boost/intrusive/list_hook.hpp +++ b/include/boost/intrusive/list_hook.hpp @@ -96,7 +96,7 @@ class list_base_hook //! initializes the node to an unlinked state. //! //! Throws: Nothing. - list_base_hook(); + list_base_hook() BOOST_NOEXCEPT; //! Effects: If link_mode is \c auto_unlink or \c safe_link //! initializes the node to an unlinked state. The argument is ignored. @@ -107,7 +107,7 @@ class list_base_hook //! makes classes using the hook STL-compliant without forcing the //! user to do some additional work. \c swap can be used to emulate //! move-semantics. - list_base_hook(const list_base_hook& ); + list_base_hook(const list_base_hook& ) BOOST_NOEXCEPT; //! Effects: Empty function. The argument is ignored. //! @@ -117,7 +117,7 @@ class list_base_hook //! makes classes using the hook STL-compliant without forcing the //! user to do some additional work. \c swap can be used to emulate //! move-semantics. - list_base_hook& operator=(const list_base_hook& ); + list_base_hook& operator=(const list_base_hook& ) BOOST_NOEXCEPT; //! Effects: If link_mode is \c normal_link, the destructor does //! nothing (ie. no code is generated). If link_mode is \c safe_link and the @@ -139,7 +139,7 @@ class list_base_hook //! Complexity: Constant //! //! Throws: Nothing. - void swap_nodes(list_base_hook &other); + void swap_nodes(list_base_hook &other) BOOST_NOEXCEPT; //! Precondition: link_mode must be \c safe_link or \c auto_unlink. //! @@ -154,7 +154,7 @@ class list_base_hook //! This function is only allowed if link_mode is \c auto_unlink. //! //! Throws: Nothing. - void unlink(); + void unlink() BOOST_NOEXCEPT; #endif }; @@ -219,7 +219,7 @@ class list_member_hook //! initializes the node to an unlinked state. //! //! Throws: Nothing. - list_member_hook(); + list_member_hook() BOOST_NOEXCEPT; //! Effects: If link_mode is \c auto_unlink or \c safe_link //! initializes the node to an unlinked state. The argument is ignored. @@ -230,7 +230,7 @@ class list_member_hook //! makes classes using the hook STL-compliant without forcing the //! user to do some additional work. \c swap can be used to emulate //! move-semantics. - list_member_hook(const list_member_hook& ); + list_member_hook(const list_member_hook& ) BOOST_NOEXCEPT; //! Effects: Empty function. The argument is ignored. //! @@ -240,7 +240,7 @@ class list_member_hook //! makes classes using the hook STL-compliant without forcing the //! user to do some additional work. \c swap can be used to emulate //! move-semantics. - list_member_hook& operator=(const list_member_hook& ); + list_member_hook& operator=(const list_member_hook& ) BOOST_NOEXCEPT; //! Effects: If link_mode is \c normal_link, the destructor does //! nothing (ie. no code is generated). If link_mode is \c safe_link and the @@ -262,7 +262,7 @@ class list_member_hook //! Complexity: Constant //! //! Throws: Nothing. - void swap_nodes(list_member_hook &other); + void swap_nodes(list_member_hook &other) BOOST_NOEXCEPT; //! Precondition: link_mode must be \c safe_link or \c auto_unlink. //! @@ -277,7 +277,7 @@ class list_member_hook //! This function is only allowed if link_mode is \c auto_unlink. //! //! Throws: Nothing. - void unlink(); + void unlink() BOOST_NOEXCEPT; #endif }; diff --git a/include/boost/intrusive/member_value_traits.hpp b/include/boost/intrusive/member_value_traits.hpp index 0ab7ffb..b20b6b8 100644 --- a/include/boost/intrusive/member_value_traits.hpp +++ b/include/boost/intrusive/member_value_traits.hpp @@ -57,19 +57,19 @@ struct member_value_traits typedef const value_type & const_reference; static const link_mode_type link_mode = LinkMode; - BOOST_INTRUSIVE_FORCEINLINE static node_ptr to_node_ptr(reference value) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr to_node_ptr(reference value) BOOST_NOEXCEPT { return pointer_traits::pointer_to(value.*PtrToMember); } - BOOST_INTRUSIVE_FORCEINLINE static const_node_ptr to_node_ptr(const_reference value) + 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_INTRUSIVE_FORCEINLINE static 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)); } - BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const const_node_ptr &n) + BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const 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/parent_from_member.hpp b/include/boost/intrusive/parent_from_member.hpp index a9a9293..9c8f167 100644 --- a/include/boost/intrusive/parent_from_member.hpp +++ b/include/boost/intrusive/parent_from_member.hpp @@ -30,7 +30,7 @@ namespace intrusive { //! Note: this function does not work with pointer to members that rely on //! virtual inheritance. template -BOOST_INTRUSIVE_FORCEINLINE Parent *get_parent_from_member(Member *member, const Member Parent::* ptr_to_member) +BOOST_INTRUSIVE_FORCEINLINE Parent *get_parent_from_member(Member *member, const Member Parent::* ptr_to_member) BOOST_NOEXCEPT { return ::boost::intrusive::detail::parent_from_member(member, ptr_to_member); } //! Given a const pointer to a member and its corresponding const pointer to data member, @@ -38,7 +38,7 @@ BOOST_INTRUSIVE_FORCEINLINE Parent *get_parent_from_member(Member *member, const //! Note: this function does not work with pointer to members that rely on //! virtual inheritance. template -BOOST_INTRUSIVE_FORCEINLINE const Parent *get_parent_from_member(const Member *member, const Member Parent::* ptr_to_member) +BOOST_INTRUSIVE_FORCEINLINE const Parent *get_parent_from_member(const Member *member, const Member Parent::* ptr_to_member) BOOST_NOEXCEPT { return ::boost::intrusive::detail::parent_from_member(member, ptr_to_member); } } //namespace intrusive { diff --git a/include/boost/intrusive/pointer_plus_bits.hpp b/include/boost/intrusive/pointer_plus_bits.hpp index 2130f3c..b967bb6 100644 --- a/include/boost/intrusive/pointer_plus_bits.hpp +++ b/include/boost/intrusive/pointer_plus_bits.hpp @@ -81,19 +81,19 @@ struct pointer_plus_bits static const uintptr_t Mask = uintptr_t((uintptr_t(1u) << NumBits) - 1); typedef T* pointer; - BOOST_INTRUSIVE_FORCEINLINE static pointer get_pointer(pointer n) + BOOST_INTRUSIVE_FORCEINLINE static pointer get_pointer(pointer n) BOOST_NOEXCEPT { return pointer(uintptr_t(n) & uintptr_t(~Mask)); } - BOOST_INTRUSIVE_FORCEINLINE static void set_pointer(pointer &n, pointer p) + BOOST_INTRUSIVE_FORCEINLINE static void set_pointer(pointer &n, pointer p) BOOST_NOEXCEPT { BOOST_INTRUSIVE_INVARIANT_ASSERT(0 == (uintptr_t(p) & Mask)); n = pointer(uintptr_t(p) | (uintptr_t(n) & Mask)); } - BOOST_INTRUSIVE_FORCEINLINE static std::size_t get_bits(pointer n) + BOOST_INTRUSIVE_FORCEINLINE static std::size_t get_bits(pointer n) BOOST_NOEXCEPT { return std::size_t(uintptr_t(n) & Mask); } - BOOST_INTRUSIVE_FORCEINLINE static void set_bits(pointer &n, std::size_t c) + BOOST_INTRUSIVE_FORCEINLINE static void set_bits(pointer &n, std::size_t c) BOOST_NOEXCEPT { BOOST_INTRUSIVE_INVARIANT_ASSERT(uintptr_t(c) <= Mask); n = pointer(uintptr_t((get_pointer)(n)) | uintptr_t(c)); diff --git a/include/boost/intrusive/pointer_traits.hpp b/include/boost/intrusive/pointer_traits.hpp index 9e8d364..548474b 100644 --- a/include/boost/intrusive/pointer_traits.hpp +++ b/include/boost/intrusive/pointer_traits.hpp @@ -123,7 +123,7 @@ struct pointer_traits //! //! Note: For non-conforming compilers only the existence of a member function called //! pointer_to is checked. - BOOST_INTRUSIVE_FORCEINLINE static pointer pointer_to(reference r) + BOOST_INTRUSIVE_FORCEINLINE static pointer pointer_to(reference r) BOOST_NOEXCEPT { //Non-standard extension, it does not require Ptr::pointer_to. If not present //tries to converts &r to pointer. @@ -143,7 +143,7 @@ struct pointer_traits //! Note: For non-conforming compilers only the existence of a member function called //! static_cast_from is checked. template - BOOST_INTRUSIVE_FORCEINLINE static pointer static_cast_from(const UPtr &uptr) + BOOST_INTRUSIVE_FORCEINLINE static pointer static_cast_from(const UPtr &uptr) BOOST_NOEXCEPT { typedef const UPtr &RefArg; const bool value = boost::intrusive::detail:: @@ -164,7 +164,7 @@ struct pointer_traits //! Note: For non-conforming compilers only the existence of a member function called //! const_cast_from is checked. template - BOOST_INTRUSIVE_FORCEINLINE static pointer const_cast_from(const UPtr &uptr) + BOOST_INTRUSIVE_FORCEINLINE static pointer const_cast_from(const UPtr &uptr) BOOST_NOEXCEPT { typedef const UPtr &RefArg; const bool value = boost::intrusive::detail:: @@ -185,7 +185,7 @@ struct pointer_traits //! Note: For non-conforming compilers only the existence of a member function called //! dynamic_cast_from is checked. template - BOOST_INTRUSIVE_FORCEINLINE static pointer dynamic_cast_from(const UPtr &uptr) + BOOST_INTRUSIVE_FORCEINLINE static pointer dynamic_cast_from(const UPtr &uptr) BOOST_NOEXCEPT { typedef const UPtr &RefArg; const bool value = boost::intrusive::detail:: @@ -201,46 +201,46 @@ struct pointer_traits private: //priv_to_raw_pointer template - BOOST_INTRUSIVE_FORCEINLINE static T* to_raw_pointer(T* p) + BOOST_INTRUSIVE_FORCEINLINE static T* to_raw_pointer(T* p) BOOST_NOEXCEPT { return p; } template BOOST_INTRUSIVE_FORCEINLINE static typename pointer_traits::element_type* - to_raw_pointer(const Pointer &p) + to_raw_pointer(const Pointer &p) BOOST_NOEXCEPT { return pointer_traits::to_raw_pointer(p.operator->()); } //priv_pointer_to - BOOST_INTRUSIVE_FORCEINLINE static pointer priv_pointer_to(boost::intrusive::detail::true_, reference r) + BOOST_INTRUSIVE_FORCEINLINE static pointer priv_pointer_to(boost::intrusive::detail::true_, reference r) BOOST_NOEXCEPT { return Ptr::pointer_to(r); } - BOOST_INTRUSIVE_FORCEINLINE static pointer priv_pointer_to(boost::intrusive::detail::false_, reference r) + BOOST_INTRUSIVE_FORCEINLINE static pointer priv_pointer_to(boost::intrusive::detail::false_, reference r) BOOST_NOEXCEPT { return pointer(boost::intrusive::detail::addressof(r)); } //priv_static_cast_from template - BOOST_INTRUSIVE_FORCEINLINE static pointer priv_static_cast_from(boost::intrusive::detail::true_, const UPtr &uptr) + BOOST_INTRUSIVE_FORCEINLINE static pointer priv_static_cast_from(boost::intrusive::detail::true_, const UPtr &uptr) BOOST_NOEXCEPT { return Ptr::static_cast_from(uptr); } template - BOOST_INTRUSIVE_FORCEINLINE static pointer priv_static_cast_from(boost::intrusive::detail::false_, const UPtr &uptr) + BOOST_INTRUSIVE_FORCEINLINE static pointer priv_static_cast_from(boost::intrusive::detail::false_, const UPtr &uptr) BOOST_NOEXCEPT { return uptr ? pointer_to(*static_cast(to_raw_pointer(uptr))) : pointer(); } //priv_const_cast_from template - BOOST_INTRUSIVE_FORCEINLINE static pointer priv_const_cast_from(boost::intrusive::detail::true_, const UPtr &uptr) + BOOST_INTRUSIVE_FORCEINLINE static pointer priv_const_cast_from(boost::intrusive::detail::true_, const UPtr &uptr) BOOST_NOEXCEPT { return Ptr::const_cast_from(uptr); } template - BOOST_INTRUSIVE_FORCEINLINE static pointer priv_const_cast_from(boost::intrusive::detail::false_, const UPtr &uptr) + BOOST_INTRUSIVE_FORCEINLINE static pointer priv_const_cast_from(boost::intrusive::detail::false_, const UPtr &uptr) BOOST_NOEXCEPT { return uptr ? pointer_to(const_cast(*uptr)) : pointer(); } //priv_dynamic_cast_from template - BOOST_INTRUSIVE_FORCEINLINE static pointer priv_dynamic_cast_from(boost::intrusive::detail::true_, const UPtr &uptr) + BOOST_INTRUSIVE_FORCEINLINE static pointer priv_dynamic_cast_from(boost::intrusive::detail::true_, const UPtr &uptr) BOOST_NOEXCEPT { return Ptr::dynamic_cast_from(uptr); } template - BOOST_INTRUSIVE_FORCEINLINE static pointer priv_dynamic_cast_from(boost::intrusive::detail::false_, const UPtr &uptr) + BOOST_INTRUSIVE_FORCEINLINE static pointer priv_dynamic_cast_from(boost::intrusive::detail::false_, const UPtr &uptr) BOOST_NOEXCEPT { return uptr ? pointer_to(dynamic_cast(*uptr)) : pointer(); } ///@endcond }; @@ -288,25 +288,25 @@ struct pointer_traits //! Returns: addressof(r) //! - BOOST_INTRUSIVE_FORCEINLINE static pointer pointer_to(reference r) + BOOST_INTRUSIVE_FORCEINLINE static pointer pointer_to(reference r) BOOST_NOEXCEPT { return boost::intrusive::detail::addressof(r); } //! Returns: static_cast(uptr) //! template - BOOST_INTRUSIVE_FORCEINLINE static pointer static_cast_from(U *uptr) + BOOST_INTRUSIVE_FORCEINLINE static pointer static_cast_from(U *uptr) BOOST_NOEXCEPT { return static_cast(uptr); } //! Returns: const_cast(uptr) //! template - BOOST_INTRUSIVE_FORCEINLINE static pointer const_cast_from(U *uptr) + BOOST_INTRUSIVE_FORCEINLINE static pointer const_cast_from(U *uptr) BOOST_NOEXCEPT { return const_cast(uptr); } //! Returns: dynamic_cast(uptr) //! template - BOOST_INTRUSIVE_FORCEINLINE static pointer dynamic_cast_from(U *uptr) + BOOST_INTRUSIVE_FORCEINLINE static pointer dynamic_cast_from(U *uptr) BOOST_NOEXCEPT { return dynamic_cast(uptr); } }; diff --git a/include/boost/intrusive/rbtree.hpp b/include/boost/intrusive/rbtree.hpp index 9d9b116..922fce5 100644 --- a/include/boost/intrusive/rbtree.hpp +++ b/include/boost/intrusive/rbtree.hpp @@ -153,61 +153,61 @@ class rbtree_impl ~rbtree_impl(); //! @copydoc ::boost::intrusive::bstree::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rbegin() - reverse_iterator rbegin(); + reverse_iterator rbegin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rbegin()const - const_reverse_iterator rbegin() const; + const_reverse_iterator rbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::crbegin()const - const_reverse_iterator crbegin() const; + const_reverse_iterator crbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rend() - reverse_iterator rend(); + reverse_iterator rend() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rend()const - const_reverse_iterator rend() const; + const_reverse_iterator rend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::crend()const - const_reverse_iterator crend() const; + const_reverse_iterator crend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::root() - iterator root(); + iterator root() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::root()const - const_iterator root() const; + const_iterator root() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::croot()const - const_iterator croot() const; + const_iterator croot() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(iterator) - static rbtree_impl &container_from_end_iterator(iterator end_iterator); + static rbtree_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(const_iterator) - static const rbtree_impl &container_from_end_iterator(const_iterator end_iterator); + static const rbtree_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_iterator(iterator) - static rbtree_impl &container_from_iterator(iterator it); + static rbtree_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_iterator(const_iterator) - static const rbtree_impl &container_from_iterator(const_iterator it); + static const rbtree_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::key_comp()const key_compare key_comp() const; @@ -216,10 +216,10 @@ class rbtree_impl value_compare value_comp() const; //! @copydoc ::boost::intrusive::bstree::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::swap void swap(rbtree_impl& other); @@ -281,26 +281,26 @@ class rbtree_impl (const_iterator hint, const key_type &key, insert_commit_data &commit_data); //! @copydoc ::boost::intrusive::bstree::insert_unique_commit - iterator insert_unique_commit(reference value, const insert_commit_data &commit_data); + iterator insert_unique_commit(reference value, const insert_commit_data &commit_data) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::insert_unique(Iterator,Iterator) template void insert_unique(Iterator b, Iterator e); //! @copydoc ::boost::intrusive::bstree::insert_before - iterator insert_before(const_iterator pos, reference value); + iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::push_back - void push_back(reference value); + void push_back(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::push_front - void push_front(reference value); + void push_front(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase(const_iterator) - iterator erase(const_iterator i); + iterator erase(const_iterator i) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase(const_iterator,const_iterator) - iterator erase(const_iterator b, const_iterator e); + iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase(const key_type &key) size_type erase(const key_type &key); @@ -311,11 +311,11 @@ class rbtree_impl //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator i, Disposer disposer); + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const key_type &, Disposer) template @@ -326,11 +326,11 @@ class rbtree_impl size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer); //! @copydoc ::boost::intrusive::bstree::clear - void clear(); + void clear() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::clear_and_dispose template - void clear_and_dispose(Disposer disposer); + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::count(const key_type &)const size_type count(const key_type &key) const; @@ -416,28 +416,28 @@ class rbtree_impl (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const; //! @copydoc ::boost::intrusive::bstree::s_iterator_to(reference) - static iterator s_iterator_to(reference value); + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::s_iterator_to(const_reference) - static const_iterator s_iterator_to(const_reference value); + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::init_node(reference) - static void init_node(reference value); + static void init_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::unlink_leftmost_without_rebalance - pointer unlink_leftmost_without_rebalance(); + pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::replace_node - void replace_node(iterator replace_this, reference with_this); + void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::remove_node - void remove_node(reference value); + void remove_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::merge_unique(bstree&) template @@ -568,16 +568,16 @@ class rbtree BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(rbtree) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static rbtree &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static rbtree &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const rbtree &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const rbtree &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static rbtree &container_from_iterator(iterator it) + BOOST_INTRUSIVE_FORCEINLINE static rbtree &container_from_iterator(iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } - BOOST_INTRUSIVE_FORCEINLINE static const rbtree &container_from_iterator(const_iterator it) + BOOST_INTRUSIVE_FORCEINLINE static const rbtree &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } }; diff --git a/include/boost/intrusive/rbtree_algorithms.hpp b/include/boost/intrusive/rbtree_algorithms.hpp index 3f3bc25..bdb0410 100644 --- a/include/boost/intrusive/rbtree_algorithms.hpp +++ b/include/boost/intrusive/rbtree_algorithms.hpp @@ -191,21 +191,21 @@ 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); + static node_ptr get_header(const const_node_ptr & n) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::begin_node - static node_ptr begin_node(const const_node_ptr & header); + static node_ptr begin_node(const const_node_ptr & header) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::end_node - static node_ptr end_node(const const_node_ptr & header); + static node_ptr end_node(const const_node_ptr & header) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::swap_tree - static void swap_tree(node_ptr header1, node_ptr header2); + static void swap_tree(node_ptr header1, node_ptr header2) BOOST_NOEXCEPT; #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr) - static void swap_nodes(node_ptr node1, node_ptr node2) + static void swap_nodes(node_ptr node1, node_ptr node2) BOOST_NOEXCEPT { if(node1 == node2) return; @@ -215,7 +215,7 @@ class rbtree_algorithms } //! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr,node_ptr,node_ptr) - static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2) + static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2) BOOST_NOEXCEPT { if(node1 == node2) return; @@ -227,7 +227,7 @@ class rbtree_algorithms } //! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr) - static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node) + static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node) BOOST_NOEXCEPT { if(node_to_be_replaced == new_node) return; @@ -235,14 +235,14 @@ class rbtree_algorithms } //! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr,node_ptr) - static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node) + static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node) BOOST_NOEXCEPT { bstree_algo::replace_node(node_to_be_replaced, header, new_node); NodeTraits::set_color(new_node, NodeTraits::get_color(node_to_be_replaced)); } //! @copydoc ::boost::intrusive::bstree_algorithms::unlink(node_ptr) - static void unlink(const node_ptr& node) + static void unlink(const node_ptr& node) BOOST_NOEXCEPT { node_ptr x = NodeTraits::get_parent(node); if(x){ @@ -254,33 +254,33 @@ 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); + static node_ptr unlink_leftmost_without_rebalance(const node_ptr & header) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::unique(const const_node_ptr&) - static bool unique(const const_node_ptr & node); + static bool unique(const 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); + static std::size_t size(const 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); + static node_ptr next_node(const node_ptr & node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::prev_node(const node_ptr&) - static node_ptr prev_node(const node_ptr & node); + static node_ptr prev_node(const node_ptr & node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::init(node_ptr) - static void init(const node_ptr & node); + static void init(const node_ptr & node) BOOST_NOEXCEPT; #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree_algorithms::init_header(node_ptr) - BOOST_INTRUSIVE_FORCEINLINE static void init_header(node_ptr header) + BOOST_INTRUSIVE_FORCEINLINE static void init_header(node_ptr header) BOOST_NOEXCEPT { bstree_algo::init_header(header); NodeTraits::set_color(header, NodeTraits::red()); } //! @copydoc ::boost::intrusive::bstree_algorithms::erase(node_ptr,node_ptr) - static node_ptr erase(node_ptr header, node_ptr z) + static node_ptr erase(node_ptr header, node_ptr z) BOOST_NOEXCEPT { typename bstree_algo::data_for_rebalance info; bstree_algo::erase(header, z, info); @@ -325,7 +325,7 @@ class rbtree_algorithms #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree_algorithms::clear_and_dispose(const node_ptr&,Disposer) template - static void clear_and_dispose(const node_ptr & header, Disposer disposer); + static void clear_and_dispose(const node_ptr & header, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare) template @@ -391,7 +391,7 @@ class rbtree_algorithms //! @copydoc ::boost::intrusive::bstree_algorithms::insert_before(node_ptr,node_ptr,node_ptr) static node_ptr insert_before - (node_ptr header, node_ptr pos, node_ptr new_node) + (node_ptr header, node_ptr pos, node_ptr new_node) BOOST_NOEXCEPT { bstree_algo::insert_before(header, pos, new_node); rebalance_after_insertion(header, new_node); @@ -399,14 +399,14 @@ class rbtree_algorithms } //! @copydoc ::boost::intrusive::bstree_algorithms::push_back(node_ptr,node_ptr) - static void push_back(node_ptr header, node_ptr new_node) + static void push_back(node_ptr header, node_ptr new_node) BOOST_NOEXCEPT { bstree_algo::push_back(header, new_node); rebalance_after_insertion(header, new_node); } //! @copydoc ::boost::intrusive::bstree_algorithms::push_front(node_ptr,node_ptr) - static void push_front(node_ptr header, node_ptr new_node) + static void push_front(node_ptr header, node_ptr new_node) BOOST_NOEXCEPT { bstree_algo::push_front(header, new_node); rebalance_after_insertion(header, new_node); @@ -428,14 +428,14 @@ class rbtree_algorithms //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_commit(node_ptr,node_ptr,const insert_commit_data&) static void insert_unique_commit - (node_ptr header, node_ptr new_value, const insert_commit_data &commit_data) + (node_ptr header, node_ptr new_value, const insert_commit_data &commit_data) BOOST_NOEXCEPT { bstree_algo::insert_unique_commit(header, new_value, commit_data); rebalance_after_insertion(header, new_value); } //! @copydoc ::boost::intrusive::bstree_algorithms::is_header - static bool is_header(const const_node_ptr & p) + static bool is_header(const const_node_ptr & p) BOOST_NOEXCEPT { return NodeTraits::get_color(p) == NodeTraits::red() && bstree_algo::is_header(p); @@ -445,7 +445,7 @@ class rbtree_algorithms private: static void rebalance_after_erasure - ( node_ptr header, node_ptr z, const typename bstree_algo::data_for_rebalance &info) + ( node_ptr header, node_ptr z, const typename bstree_algo::data_for_rebalance &info) BOOST_NOEXCEPT { color new_z_color; if(info.y != z){ @@ -461,7 +461,7 @@ class rbtree_algorithms } } - static void rebalance_after_erasure_restore_invariants(node_ptr header, node_ptr x, node_ptr x_parent) + static void rebalance_after_erasure_restore_invariants(node_ptr header, node_ptr x, node_ptr x_parent) BOOST_NOEXCEPT { while(1){ if(x_parent == header || (x && NodeTraits::get_color(x) != NodeTraits::black())){ @@ -545,7 +545,7 @@ class rbtree_algorithms NodeTraits::set_color(x, NodeTraits::black()); } - static void rebalance_after_insertion(node_ptr header, node_ptr p) + static void rebalance_after_insertion(node_ptr header, node_ptr p) BOOST_NOEXCEPT { NodeTraits::set_color(p, NodeTraits::red()); while(1){ diff --git a/include/boost/intrusive/set.hpp b/include/boost/intrusive/set.hpp index 366931f..30f0760 100644 --- a/include/boost/intrusive/set.hpp +++ b/include/boost/intrusive/set.hpp @@ -120,61 +120,61 @@ class set_impl ~set_impl(); //! @copydoc ::boost::intrusive::rbtree::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::rbegin() - reverse_iterator rbegin(); + reverse_iterator rbegin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::rbegin()const - const_reverse_iterator rbegin() const; + const_reverse_iterator rbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::crbegin()const - const_reverse_iterator crbegin() const; + const_reverse_iterator crbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::rend() - reverse_iterator rend(); + reverse_iterator rend() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::rend()const - const_reverse_iterator rend() const; + const_reverse_iterator rend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::crend()const - const_reverse_iterator crend() const; + const_reverse_iterator crend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::root() - iterator root(); + iterator root() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::root()const - const_iterator root() const; + const_iterator root() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::croot()const - const_iterator croot() const; + const_iterator croot() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::container_from_end_iterator(iterator) - static set_impl &container_from_end_iterator(iterator end_iterator); + static set_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::container_from_end_iterator(const_iterator) - static const set_impl &container_from_end_iterator(const_iterator end_iterator); + static const set_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::container_from_iterator(iterator) - static set_impl &container_from_iterator(iterator it); + static set_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::container_from_iterator(const_iterator) - static const set_impl &container_from_iterator(const_iterator it); + static const set_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::key_comp()const key_compare key_comp() const; @@ -183,10 +183,10 @@ class set_impl value_compare value_comp() const; //! @copydoc ::boost::intrusive::rbtree::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::swap void swap(set_impl& other); @@ -244,24 +244,24 @@ class set_impl { tree_type::insert_unique(b, e); } //! @copydoc ::boost::intrusive::rbtree::insert_unique_commit - iterator insert_commit(reference value, const insert_commit_data &commit_data) + iterator insert_commit(reference value, const insert_commit_data &commit_data) BOOST_NOEXCEPT { return tree_type::insert_unique_commit(value, commit_data); } #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::rbtree::insert_before - iterator insert_before(const_iterator pos, reference value); + iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::push_back - void push_back(reference value); + void push_back(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::push_front - void push_front(reference value); + void push_front(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::erase(const_iterator) - iterator erase(const_iterator i); + iterator erase(const_iterator i) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::erase(const_iterator,const_iterator) - iterator erase(const_iterator b, const_iterator e); + iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::erase(const key_type &) size_type erase(const key_type &key); @@ -272,11 +272,11 @@ class set_impl //! @copydoc ::boost::intrusive::rbtree::erase_and_dispose(const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator i, Disposer disposer); + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::erase_and_dispose(const_iterator,const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::erase_and_dispose(const key_type &, Disposer) template @@ -287,11 +287,11 @@ class set_impl size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer); //! @copydoc ::boost::intrusive::rbtree::clear - void clear(); + void clear() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::clear_and_dispose template - void clear_and_dispose(Disposer disposer); + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT; #endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED @@ -391,28 +391,28 @@ class set_impl (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const; //! @copydoc ::boost::intrusive::rbtree::s_iterator_to(reference) - static iterator s_iterator_to(reference value); + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::s_iterator_to(const_reference) - static const_iterator s_iterator_to(const_reference value); + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::init_node(reference) - static void init_node(reference value); + static void init_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::unlink_leftmost_without_rebalance - pointer unlink_leftmost_without_rebalance(); + pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::replace_node - void replace_node(iterator replace_this, reference with_this); + void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::remove_node - void remove_node(reference value); + void remove_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::merge_unique template @@ -555,16 +555,16 @@ class set BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(set) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static set &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static set &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const set &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const set &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static set &container_from_iterator(iterator it) + BOOST_INTRUSIVE_FORCEINLINE static set &container_from_iterator(iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } - BOOST_INTRUSIVE_FORCEINLINE static const set &container_from_iterator(const_iterator it) + BOOST_INTRUSIVE_FORCEINLINE static const set &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } }; @@ -657,61 +657,61 @@ class multiset_impl ~multiset_impl(); //! @copydoc ::boost::intrusive::rbtree::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::rbegin() - reverse_iterator rbegin(); + reverse_iterator rbegin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::rbegin()const - const_reverse_iterator rbegin() const; + const_reverse_iterator rbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::crbegin()const - const_reverse_iterator crbegin() const; + const_reverse_iterator crbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::rend() - reverse_iterator rend(); + reverse_iterator rend() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::rend()const - const_reverse_iterator rend() const; + const_reverse_iterator rend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::crend()const - const_reverse_iterator crend() const; + const_reverse_iterator crend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::root() - iterator root(); + iterator root() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::root()const - const_iterator root() const; + const_iterator root() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::croot()const - const_iterator croot() const; + const_iterator croot() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::container_from_end_iterator(iterator) - static multiset_impl &container_from_end_iterator(iterator end_iterator); + static multiset_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::container_from_end_iterator(const_iterator) - static const multiset_impl &container_from_end_iterator(const_iterator end_iterator); + static const multiset_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::container_from_iterator(iterator) - static multiset_impl &container_from_iterator(iterator it); + static multiset_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::container_from_iterator(const_iterator) - static const multiset_impl &container_from_iterator(const_iterator it); + static const multiset_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::key_comp()const key_compare key_comp() const; @@ -720,10 +720,10 @@ class multiset_impl value_compare value_comp() const; //! @copydoc ::boost::intrusive::rbtree::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::swap void swap(multiset_impl& other); @@ -758,19 +758,19 @@ class multiset_impl #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::rbtree::insert_before - iterator insert_before(const_iterator pos, reference value); + iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::push_back - void push_back(reference value); + void push_back(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::push_front - void push_front(reference value); + void push_front(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::erase(const_iterator) - iterator erase(const_iterator i); + iterator erase(const_iterator i) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::erase(const_iterator,const_iterator) - iterator erase(const_iterator b, const_iterator e); + iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::erase(const key_type &) size_type erase(const key_type &key); @@ -781,11 +781,11 @@ class multiset_impl //! @copydoc ::boost::intrusive::rbtree::erase_and_dispose(const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator i, Disposer disposer); + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::erase_and_dispose(const_iterator,const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::erase_and_dispose(const key_type &, Disposer) template @@ -796,11 +796,11 @@ class multiset_impl size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer); //! @copydoc ::boost::intrusive::rbtree::clear - void clear(); + void clear() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::clear_and_dispose template - void clear_and_dispose(Disposer disposer); + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::count(const key_type &)const size_type count(const key_type &key) const; @@ -886,28 +886,28 @@ class multiset_impl (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const; //! @copydoc ::boost::intrusive::rbtree::s_iterator_to(reference) - static iterator s_iterator_to(reference value); + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::s_iterator_to(const_reference) - static const_iterator s_iterator_to(const_reference value); + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::init_node(reference) - static void init_node(reference value); + static void init_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::unlink_leftmost_without_rebalance - pointer unlink_leftmost_without_rebalance(); + pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::replace_node - void replace_node(iterator replace_this, reference with_this); + void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::remove_node - void remove_node(reference value); + void remove_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::merge_equal template @@ -1050,16 +1050,16 @@ class multiset BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(multiset) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static multiset &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static multiset &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const multiset &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const multiset &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static multiset &container_from_iterator(iterator it) + BOOST_INTRUSIVE_FORCEINLINE static multiset &container_from_iterator(iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } - BOOST_INTRUSIVE_FORCEINLINE static const multiset &container_from_iterator(const_iterator it) + BOOST_INTRUSIVE_FORCEINLINE static const multiset &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } }; diff --git a/include/boost/intrusive/set_hook.hpp b/include/boost/intrusive/set_hook.hpp index e303b64..fed331c 100644 --- a/include/boost/intrusive/set_hook.hpp +++ b/include/boost/intrusive/set_hook.hpp @@ -99,7 +99,7 @@ class set_base_hook //! initializes the node to an unlinked state. //! //! Throws: Nothing. - set_base_hook(); + set_base_hook() BOOST_NOEXCEPT; //! Effects: If link_mode is \c auto_unlink or \c safe_link //! initializes the node to an unlinked state. The argument is ignored. @@ -110,7 +110,7 @@ class set_base_hook //! makes classes using the hook STL-compliant without forcing the //! user to do some additional work. \c swap can be used to emulate //! move-semantics. - set_base_hook(const set_base_hook& ); + set_base_hook(const set_base_hook& ) BOOST_NOEXCEPT; //! Effects: Empty function. The argument is ignored. //! @@ -120,7 +120,7 @@ class set_base_hook //! makes classes using the hook STL-compliant without forcing the //! user to do some additional work. \c swap can be used to emulate //! move-semantics. - set_base_hook& operator=(const set_base_hook& ); + set_base_hook& operator=(const set_base_hook& ) BOOST_NOEXCEPT; //! Effects: If link_mode is \c normal_link, the destructor does //! nothing (ie. no code is generated). If link_mode is \c safe_link and the @@ -142,7 +142,7 @@ class set_base_hook //! Complexity: Constant //! //! Throws: Nothing. - void swap_nodes(set_base_hook &other); + void swap_nodes(set_base_hook &other) BOOST_NOEXCEPT; //! Precondition: link_mode must be \c safe_link or \c auto_unlink. //! @@ -151,13 +151,13 @@ class set_base_hook //! will return a valid iterator. //! //! Complexity: Constant - bool is_linked() const; + bool is_linked() const BOOST_NOEXCEPT; //! Effects: Removes the node if it's inserted in a container. //! This function is only allowed if link_mode is \c auto_unlink. //! //! Throws: Nothing. - void unlink(); + void unlink() BOOST_NOEXCEPT; #endif }; @@ -226,7 +226,7 @@ class set_member_hook //! initializes the node to an unlinked state. //! //! Throws: Nothing. - set_member_hook(); + set_member_hook() BOOST_NOEXCEPT; //! Effects: If link_mode is \c auto_unlink or \c safe_link //! initializes the node to an unlinked state. The argument is ignored. @@ -237,7 +237,7 @@ class set_member_hook //! makes classes using the hook STL-compliant without forcing the //! user to do some additional work. \c swap can be used to emulate //! move-semantics. - set_member_hook(const set_member_hook& ); + set_member_hook(const set_member_hook& ) BOOST_NOEXCEPT; //! Effects: Empty function. The argument is ignored. //! @@ -247,7 +247,7 @@ class set_member_hook //! makes classes using the hook STL-compliant without forcing the //! user to do some additional work. \c swap can be used to emulate //! move-semantics. - set_member_hook& operator=(const set_member_hook& ); + set_member_hook& operator=(const set_member_hook& ) BOOST_NOEXCEPT; //! Effects: If link_mode is \c normal_link, the destructor does //! nothing (ie. no code is generated). If link_mode is \c safe_link and the @@ -269,7 +269,7 @@ class set_member_hook //! Complexity: Constant //! //! Throws: Nothing. - void swap_nodes(set_member_hook &other); + void swap_nodes(set_member_hook &other) BOOST_NOEXCEPT; //! Precondition: link_mode must be \c safe_link or \c auto_unlink. //! @@ -278,13 +278,13 @@ class set_member_hook //! will return a valid iterator. //! //! Complexity: Constant - bool is_linked() const; + bool is_linked() const BOOST_NOEXCEPT; //! Effects: Removes the node if it's inserted in a container. //! This function is only allowed if link_mode is \c auto_unlink. //! //! Throws: Nothing. - void unlink(); + void unlink() BOOST_NOEXCEPT; #endif }; diff --git a/include/boost/intrusive/sg_set.hpp b/include/boost/intrusive/sg_set.hpp index 4144e14..72c412d 100644 --- a/include/boost/intrusive/sg_set.hpp +++ b/include/boost/intrusive/sg_set.hpp @@ -118,61 +118,61 @@ class sg_set_impl ~sg_set_impl(); //! @copydoc ::boost::intrusive::sgtree::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::rbegin() - reverse_iterator rbegin(); + reverse_iterator rbegin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::rbegin()const - const_reverse_iterator rbegin() const; + const_reverse_iterator rbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::crbegin()const - const_reverse_iterator crbegin() const; + const_reverse_iterator crbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::rend() - reverse_iterator rend(); + reverse_iterator rend() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::rend()const - const_reverse_iterator rend() const; + const_reverse_iterator rend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::crend()const - const_reverse_iterator crend() const; + const_reverse_iterator crend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::root() - iterator root(); + iterator root() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::root()const - const_iterator root() const; + const_iterator root() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::croot()const - const_iterator croot() const; + const_iterator croot() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::container_from_end_iterator(iterator) - static sg_set_impl &container_from_end_iterator(iterator end_iterator); + static sg_set_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::container_from_end_iterator(const_iterator) - static const sg_set_impl &container_from_end_iterator(const_iterator end_iterator); + static const sg_set_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::container_from_iterator(iterator) - static sg_set_impl &container_from_iterator(iterator it); + static sg_set_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::container_from_iterator(const_iterator) - static const sg_set_impl &container_from_iterator(const_iterator it); + static const sg_set_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::key_comp()const key_compare key_comp() const; @@ -181,10 +181,10 @@ class sg_set_impl value_compare value_comp() const; //! @copydoc ::boost::intrusive::sgtree::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::swap void swap(sg_set_impl& other); @@ -242,24 +242,24 @@ class sg_set_impl { tree_type::insert_unique(b, e); } //! @copydoc ::boost::intrusive::sgtree::insert_unique_commit - iterator insert_commit(reference value, const insert_commit_data &commit_data) + iterator insert_commit(reference value, const insert_commit_data &commit_data) BOOST_NOEXCEPT { return tree_type::insert_unique_commit(value, commit_data); } #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::sgtree::insert_before - iterator insert_before(const_iterator pos, reference value); + iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::push_back - void push_back(reference value); + void push_back(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::push_front - void push_front(reference value); + void push_front(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::erase(const_iterator) - iterator erase(const_iterator i); + iterator erase(const_iterator i) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::erase(const_iterator,const_iterator) - iterator erase(const_iterator b, const_iterator e); + iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::erase(const key_type &) size_type erase(const key_type &key); @@ -270,11 +270,11 @@ class sg_set_impl //! @copydoc ::boost::intrusive::sgtree::erase_and_dispose(const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator i, Disposer disposer); + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::erase_and_dispose(const_iterator,const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::erase_and_dispose(const key_type &, Disposer) template @@ -285,11 +285,11 @@ class sg_set_impl size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer); //! @copydoc ::boost::intrusive::sgtree::clear - void clear(); + void clear() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::clear_and_dispose template - void clear_and_dispose(Disposer disposer); + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT; #endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED @@ -389,40 +389,40 @@ class sg_set_impl (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const; //! @copydoc ::boost::intrusive::sgtree::s_iterator_to(reference) - static iterator s_iterator_to(reference value); + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::s_iterator_to(const_reference) - static const_iterator s_iterator_to(const_reference value); + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::init_node(reference) - static void init_node(reference value); + static void init_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::unlink_leftmost_without_rebalance - pointer unlink_leftmost_without_rebalance(); + pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::replace_node - void replace_node(iterator replace_this, reference with_this); + void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::remove_node - void remove_node(reference value); + void remove_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::rebalance - void rebalance(); + void rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::rebalance_subtree - iterator rebalance_subtree(iterator root); + iterator rebalance_subtree(iterator root) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::balance_factor() - float balance_factor() const; + float balance_factor() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::balance_factor(float) - void balance_factor(float new_alpha); + void balance_factor(float new_alpha) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::rbtree::merge_unique template @@ -564,16 +564,16 @@ class sg_set BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(sg_set) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static sg_set &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static sg_set &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const sg_set &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const sg_set &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static sg_set &container_from_iterator(iterator it) + BOOST_INTRUSIVE_FORCEINLINE static sg_set &container_from_iterator(iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } - BOOST_INTRUSIVE_FORCEINLINE static const sg_set &container_from_iterator(const_iterator it) + BOOST_INTRUSIVE_FORCEINLINE static const sg_set &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } }; @@ -666,61 +666,61 @@ class sg_multiset_impl ~sg_multiset_impl(); //! @copydoc ::boost::intrusive::sgtree::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::rbegin() - reverse_iterator rbegin(); + reverse_iterator rbegin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::rbegin()const - const_reverse_iterator rbegin() const; + const_reverse_iterator rbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::crbegin()const - const_reverse_iterator crbegin() const; + const_reverse_iterator crbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::rend() - reverse_iterator rend(); + reverse_iterator rend() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::rend()const - const_reverse_iterator rend() const; + const_reverse_iterator rend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::crend()const - const_reverse_iterator crend() const; + const_reverse_iterator crend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::root() - iterator root(); + iterator root() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::root()const - const_iterator root() const; + const_iterator root() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::croot()const - const_iterator croot() const; + const_iterator croot() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::container_from_end_iterator(iterator) - static sg_multiset_impl &container_from_end_iterator(iterator end_iterator); + static sg_multiset_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::container_from_end_iterator(const_iterator) - static const sg_multiset_impl &container_from_end_iterator(const_iterator end_iterator); + static const sg_multiset_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::container_from_iterator(iterator) - static sg_multiset_impl &container_from_iterator(iterator it); + static sg_multiset_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::container_from_iterator(const_iterator) - static const sg_multiset_impl &container_from_iterator(const_iterator it); + static const sg_multiset_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::key_comp()const key_compare key_comp() const; @@ -729,10 +729,10 @@ class sg_multiset_impl value_compare value_comp() const; //! @copydoc ::boost::intrusive::sgtree::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::swap void swap(sg_multiset_impl& other); @@ -767,19 +767,19 @@ class sg_multiset_impl #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::sgtree::insert_before - iterator insert_before(const_iterator pos, reference value); + iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::push_back - void push_back(reference value); + void push_back(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::push_front - void push_front(reference value); + void push_front(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::erase(const_iterator) - iterator erase(const_iterator i); + iterator erase(const_iterator i) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::erase(const_iterator,const_iterator) - iterator erase(const_iterator b, const_iterator e); + iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::erase(const key_type &) size_type erase(const key_type &key); @@ -790,11 +790,11 @@ class sg_multiset_impl //! @copydoc ::boost::intrusive::sgtree::erase_and_dispose(const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator i, Disposer disposer); + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::erase_and_dispose(const_iterator,const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::erase_and_dispose(const key_type &, Disposer) template @@ -805,11 +805,11 @@ class sg_multiset_impl size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer); //! @copydoc ::boost::intrusive::sgtree::clear - void clear(); + void clear() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::clear_and_dispose template - void clear_and_dispose(Disposer disposer); + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::count(const key_type &)const size_type count(const key_type &key) const; @@ -895,40 +895,40 @@ class sg_multiset_impl (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const; //! @copydoc ::boost::intrusive::sgtree::s_iterator_to(reference) - static iterator s_iterator_to(reference value); + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::s_iterator_to(const_reference) - static const_iterator s_iterator_to(const_reference value); + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::init_node(reference) - static void init_node(reference value); + static void init_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::unlink_leftmost_without_rebalance - pointer unlink_leftmost_without_rebalance(); + pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::replace_node - void replace_node(iterator replace_this, reference with_this); + void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::remove_node - void remove_node(reference value); + void remove_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::rebalance - void rebalance(); + void rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::rebalance_subtree - iterator rebalance_subtree(iterator root); + iterator rebalance_subtree(iterator root) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::balance_factor() - float balance_factor() const; + float balance_factor() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::sgtree::balance_factor(float) - void balance_factor(float new_alpha); + void balance_factor(float new_alpha) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::merge_unique template @@ -1071,16 +1071,16 @@ class sg_multiset BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(sg_multiset) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static sg_multiset &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static sg_multiset &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const sg_multiset &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const sg_multiset &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static sg_multiset &container_from_iterator(iterator it) + BOOST_INTRUSIVE_FORCEINLINE static sg_multiset &container_from_iterator(iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } - BOOST_INTRUSIVE_FORCEINLINE static const sg_multiset &container_from_iterator(const_iterator it) + BOOST_INTRUSIVE_FORCEINLINE static const sg_multiset &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } }; diff --git a/include/boost/intrusive/sgtree.hpp b/include/boost/intrusive/sgtree.hpp index 71223bf..9e687da 100644 --- a/include/boost/intrusive/sgtree.hpp +++ b/include/boost/intrusive/sgtree.hpp @@ -346,61 +346,61 @@ class sgtree_impl ~sgtree_impl(); //! @copydoc ::boost::intrusive::bstree::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rbegin() - reverse_iterator rbegin(); + reverse_iterator rbegin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rbegin()const - const_reverse_iterator rbegin() const; + const_reverse_iterator rbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::crbegin()const - const_reverse_iterator crbegin() const; + const_reverse_iterator crbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rend() - reverse_iterator rend(); + reverse_iterator rend() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rend()const - const_reverse_iterator rend() const; + const_reverse_iterator rend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::crend()const - const_reverse_iterator crend() const; + const_reverse_iterator crend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::root() - iterator root(); + iterator root() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::root()const - const_iterator root() const; + const_iterator root() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::croot()const - const_iterator croot() const; + const_iterator croot() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(iterator) - static sgtree_impl &container_from_end_iterator(iterator end_iterator); + static sgtree_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(const_iterator) - static const sgtree_impl &container_from_end_iterator(const_iterator end_iterator); + static const sgtree_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_iterator(iterator) - static sgtree_impl &container_from_iterator(iterator it); + static sgtree_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_iterator(const_iterator) - static const sgtree_impl &container_from_iterator(const_iterator it); + static const sgtree_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::key_comp()const key_compare key_comp() const; @@ -409,10 +409,10 @@ class sgtree_impl value_compare value_comp() const; //! @copydoc ::boost::intrusive::bstree::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED @@ -539,7 +539,7 @@ class sgtree_impl { return this->insert_unique_check(hint, key, this->key_comp(), commit_data); } //! @copydoc ::boost::intrusive::bstree::insert_unique_commit - iterator insert_unique_commit(reference value, const insert_commit_data &commit_data) + iterator insert_unique_commit(reference value, const insert_commit_data &commit_data) BOOST_NOEXCEPT { node_ptr to_insert(this->get_value_traits().to_node_ptr(value)); BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::unique(to_insert)); @@ -568,7 +568,7 @@ class sgtree_impl } //! @copydoc ::boost::intrusive::bstree::insert_before - iterator insert_before(const_iterator pos, reference value) + iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT { node_ptr to_insert(this->get_value_traits().to_node_ptr(value)); BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::unique(to_insert)); @@ -582,7 +582,7 @@ class sgtree_impl } //! @copydoc ::boost::intrusive::bstree::push_back - void push_back(reference value) + void push_back(reference value) BOOST_NOEXCEPT { node_ptr to_insert(this->get_value_traits().to_node_ptr(value)); BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::unique(to_insert)); @@ -595,7 +595,7 @@ class sgtree_impl } //! @copydoc ::boost::intrusive::bstree::push_front - void push_front(reference value) + void push_front(reference value) BOOST_NOEXCEPT { node_ptr to_insert(this->get_value_traits().to_node_ptr(value)); BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::unique(to_insert)); @@ -609,7 +609,7 @@ class sgtree_impl //! @copydoc ::boost::intrusive::bstree::erase(const_iterator) - iterator erase(const_iterator i) + iterator erase(const_iterator i) BOOST_NOEXCEPT { const_iterator ret(i); ++ret; @@ -621,13 +621,13 @@ class sgtree_impl , max_tree_size, this->get_alpha_by_max_size_func()); this->max_tree_size_ = (size_type)max_tree_size; this->tree_type::sz_traits().decrement(); - if(safemode_or_autounlink) + BOOST_IF_CONSTEXPR(safemode_or_autounlink) node_algorithms::init(to_erase); return ret.unconst(); } //! @copydoc ::boost::intrusive::bstree::erase(const_iterator,const_iterator) - iterator erase(const_iterator b, const_iterator e) + iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT { size_type n; return private_erase(b, e, n); } //! @copydoc ::boost::intrusive::bstree::erase(const key_type &) @@ -648,7 +648,7 @@ class sgtree_impl //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator i, Disposer disposer) + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT { node_ptr to_erase(i.pointed_node()); iterator ret(this->erase(i)); @@ -658,13 +658,13 @@ class sgtree_impl #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) template - iterator erase_and_dispose(iterator i, Disposer disposer) + iterator erase_and_dispose(iterator i, Disposer disposer) BOOST_NOEXCEPT { return this->erase_and_dispose(const_iterator(i), disposer); } #endif //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT { size_type n; return private_erase(b, e, n, disposer); } //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const key_type &, Disposer) @@ -690,7 +690,7 @@ class sgtree_impl } //! @copydoc ::boost::intrusive::bstree::clear - void clear() + void clear() BOOST_NOEXCEPT { tree_type::clear(); this->max_tree_size_ = 0; @@ -698,7 +698,7 @@ class sgtree_impl //! @copydoc ::boost::intrusive::bstree::clear_and_dispose template - void clear_and_dispose(Disposer disposer) + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT { tree_type::clear_and_dispose(disposer); this->max_tree_size_ = 0; @@ -849,34 +849,34 @@ class sgtree_impl (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const; //! @copydoc ::boost::intrusive::bstree::s_iterator_to(reference) - static iterator s_iterator_to(reference value); + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::s_iterator_to(const_reference) - static const_iterator s_iterator_to(const_reference value); + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::init_node(reference) - static void init_node(reference value); + static void init_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::unlink_leftmost_without_rebalance - pointer unlink_leftmost_without_rebalance(); + pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::replace_node - void replace_node(iterator replace_this, reference with_this); + void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::remove_node - void remove_node(reference value); + void remove_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rebalance - void rebalance(); + void rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rebalance_subtree - iterator rebalance_subtree(iterator root); + iterator rebalance_subtree(iterator root) BOOST_NOEXCEPT; friend bool operator< (const sgtree_impl &x, const sgtree_impl &y); @@ -899,7 +899,7 @@ class sgtree_impl //! Throws: Nothing. //! //! Complexity: Constant. - float balance_factor() const + float balance_factor() const BOOST_NOEXCEPT { return this->get_alpha_traits().get_alpha(); } //! Requires: new_alpha must be a value between 0.5 and 1.0 @@ -910,7 +910,7 @@ class sgtree_impl //! Throws: Nothing. //! //! Complexity: Linear to the elements in the subtree. - void balance_factor(float new_alpha) + void balance_factor(float new_alpha) BOOST_NOEXCEPT { //The alpha factor CAN't be changed if the fixed, floating operation-less //1/sqrt(2) alpha factor option is activated @@ -929,14 +929,14 @@ class sgtree_impl /// @cond private: template - iterator private_erase(const_iterator b, const_iterator e, size_type &n, Disposer disposer) + iterator private_erase(const_iterator b, const_iterator e, size_type &n, Disposer disposer) BOOST_NOEXCEPT { for(n = 0; b != e; ++n) this->erase_and_dispose(b++, disposer); return b.unconst(); } - iterator private_erase(const_iterator b, const_iterator e, size_type &n) + iterator private_erase(const_iterator b, const_iterator e, size_type &n) BOOST_NOEXCEPT { for(n = 0; b != e; ++n) this->erase(b++); @@ -1050,16 +1050,16 @@ class sgtree BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(sgtree) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static sgtree &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static sgtree &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const sgtree &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const sgtree &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static sgtree &container_from_iterator(iterator it) + BOOST_INTRUSIVE_FORCEINLINE static sgtree &container_from_iterator(iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } - BOOST_INTRUSIVE_FORCEINLINE static const sgtree &container_from_iterator(const_iterator it) + BOOST_INTRUSIVE_FORCEINLINE static const sgtree &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } }; diff --git a/include/boost/intrusive/sgtree_algorithms.hpp b/include/boost/intrusive/sgtree_algorithms.hpp index a3e233c..575003d 100644 --- a/include/boost/intrusive/sgtree_algorithms.hpp +++ b/include/boost/intrusive/sgtree_algorithms.hpp @@ -86,52 +86,52 @@ class sgtree_algorithms #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree_algorithms::get_header(const const_node_ptr&) - static node_ptr get_header(const_node_ptr n); + static node_ptr get_header(const_node_ptr n) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::begin_node - static node_ptr begin_node(const_node_ptr header); + static node_ptr begin_node(const_node_ptr header) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::end_node - static node_ptr end_node(const_node_ptr header); + 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); + static void swap_tree(node_ptr header1, node_ptr header2) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr) - static void swap_nodes(node_ptr node1, node_ptr node2); + static void swap_nodes(node_ptr node1, node_ptr node2) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr,node_ptr,node_ptr) - static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2); + static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr) - static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node); + static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr,node_ptr) - static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node); + static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node) BOOST_NOEXCEPT; //Unlink is not possible since tree metadata is needed to update the tree - //!static void unlink(node_ptr node); + //!static void unlink(node_ptr node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::unlink_leftmost_without_rebalance - static node_ptr unlink_leftmost_without_rebalance(node_ptr header); + 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_node_ptr node); + 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_node_ptr header); + 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(node_ptr node); + 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(node_ptr node); + static node_ptr prev_node(node_ptr node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::init(node_ptr) - static void init(node_ptr node); + static void init(node_ptr node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::init_header(node_ptr) - static void init_header(node_ptr header); + static void init_header(node_ptr header) BOOST_NOEXCEPT; #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree_algorithms::erase(node_ptr,node_ptr) @@ -156,7 +156,7 @@ class sgtree_algorithms //! @copydoc ::boost::intrusive::bstree_algorithms::clear_and_dispose(const node_ptr&,Disposer) template - static void clear_and_dispose(node_ptr header, Disposer disposer); + 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) template @@ -241,7 +241,7 @@ class sgtree_algorithms //! @copydoc ::boost::intrusive::bstree_algorithms::push_back(node_ptr,node_ptr) template static void push_back(node_ptr header, node_ptr new_node - ,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size) + ,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size) BOOST_NOEXCEPT { std::size_t depth; bstree_algo::push_back(header, new_node, &depth); @@ -251,7 +251,7 @@ class sgtree_algorithms //! @copydoc ::boost::intrusive::bstree_algorithms::push_front(node_ptr,node_ptr) template static void push_front(node_ptr header, node_ptr new_node - ,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size) + ,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size) BOOST_NOEXCEPT { std::size_t depth; bstree_algo::push_front(header, new_node, &depth); @@ -323,13 +323,13 @@ class sgtree_algorithms #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree_algorithms::is_header - static bool is_header(const_node_ptr p); + static bool is_header(const_node_ptr p) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::is_header - static void rebalance(node_ptr header); + static void rebalance(node_ptr header) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::rebalance_subtree - static node_ptr rebalance_subtree(node_ptr old_root) + static node_ptr rebalance_subtree(node_ptr old_root) BOOST_NOEXCEPT #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED /// @cond @@ -348,7 +348,7 @@ class sgtree_algorithms template static void insert_commit (node_ptr header, node_ptr new_value, const insert_commit_data &commit_data - ,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size) + ,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size) BOOST_NOEXCEPT { bstree_algo::insert_unique_commit(header, new_value, commit_data); rebalance_after_insertion(new_value, commit_data.depth, tree_size+1, h_alpha, max_tree_size); @@ -357,7 +357,7 @@ class sgtree_algorithms template static void rebalance_after_insertion (node_ptr x, std::size_t depth - , std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size) + , std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size) BOOST_NOEXCEPT { if(tree_size > max_tree_size) max_tree_size = tree_size; diff --git a/include/boost/intrusive/slist.hpp b/include/boost/intrusive/slist.hpp index 699aca7..4f0871d 100644 --- a/include/boost/intrusive/slist.hpp +++ b/include/boost/intrusive/slist.hpp @@ -220,7 +220,7 @@ class slist_impl { node_algorithms::init_header(this->get_root_node()); this->priv_size_traits().set_size(size_type(0)); - if(cache_last){ + BOOST_IF_CONSTEXPR(cache_last){ this->set_last_node(this->get_root_node()); } } @@ -287,7 +287,7 @@ class slist_impl { if(n){ this->priv_size_traits().set_size(n); - if(cache_last){ + BOOST_IF_CONSTEXPR(cache_last){ this->set_last_node(before_l); } node_traits::set_next(this->get_root_node(), f); @@ -370,7 +370,7 @@ class slist_impl //! it's a safe-mode or auto-unlink value. Otherwise constant. ~slist_impl() { - if(is_safe_autounlink::value){ + BOOST_IF_CONSTEXPR(is_safe_autounlink::value){ this->clear(); node_algorithms::init(this->get_root_node()); } @@ -384,9 +384,9 @@ class slist_impl //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise. //! //! Note: Invalidates the iterators (but not the references) to the erased elements. - void clear() + void clear() BOOST_NOEXCEPT { - if(safemode_or_autounlink){ + BOOST_IF_CONSTEXPR(safemode_or_autounlink){ this->clear_and_dispose(detail::null_disposer()); } else{ @@ -405,13 +405,13 @@ class slist_impl //! //! Note: Invalidates the iterators to the erased elements. template - void clear_and_dispose(Disposer disposer) + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT { const_iterator it(this->begin()), itend(this->end()); while(it != itend){ node_ptr to_erase(it.pointed_node()); ++it; - if(safemode_or_autounlink) + BOOST_IF_CONSTEXPR(safemode_or_autounlink) node_algorithms::init(to_erase); disposer(priv_value_traits().to_value_ptr(to_erase)); } @@ -428,11 +428,11 @@ class slist_impl //! Complexity: Constant. //! //! Note: Does not affect the validity of iterators and references. - void push_front(reference value) + void push_front(reference value) BOOST_NOEXCEPT { node_ptr to_insert = priv_value_traits().to_node_ptr(value); BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::inited(to_insert)); - if(cache_last){ + BOOST_IF_CONSTEXPR(cache_last){ if(this->empty()){ this->set_last_node(to_insert); } @@ -452,13 +452,13 @@ class slist_impl //! //! Note: Does not affect the validity of iterators and references. //! This function is only available is cache_last<> is true. - void push_back(reference value) + void push_back(reference value) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT((cache_last)); node_ptr n = priv_value_traits().to_node_ptr(value); BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::inited(n)); node_algorithms::link_after(this->get_last_node(), n); - if(cache_last){ + BOOST_IF_CONSTEXPR(cache_last){ this->set_last_node(n); } this->priv_size_traits().increment(); @@ -472,7 +472,7 @@ class slist_impl //! Complexity: Constant. //! //! Note: Invalidates the iterators (but not the references) to the erased element. - void pop_front() + void pop_front() BOOST_NOEXCEPT { return this->pop_front_and_dispose(detail::null_disposer()); } //! Requires: Disposer::operator()(pointer) shouldn't throw. @@ -486,15 +486,15 @@ class slist_impl //! //! Note: Invalidates the iterators to the erased element. template - void pop_front_and_dispose(Disposer disposer) + void pop_front_and_dispose(Disposer disposer) BOOST_NOEXCEPT { node_ptr to_erase = node_traits::get_next(this->get_root_node()); node_algorithms::unlink_after(this->get_root_node()); this->priv_size_traits().decrement(); - if(safemode_or_autounlink) + BOOST_IF_CONSTEXPR(safemode_or_autounlink) node_algorithms::init(to_erase); disposer(priv_value_traits().to_value_ptr(to_erase)); - if(cache_last){ + BOOST_IF_CONSTEXPR(cache_last){ if(this->empty()){ this->set_last_node(this->get_root_node()); } @@ -506,7 +506,7 @@ class slist_impl //! Throws: Nothing. //! //! Complexity: Constant. - reference front() + BOOST_INTRUSIVE_FORCEINLINE reference front() BOOST_NOEXCEPT { return *this->priv_value_traits().to_value_ptr(node_traits::get_next(this->get_root_node())); } //! Effects: Returns a const_reference to the first element of the list. @@ -514,7 +514,7 @@ class slist_impl //! Throws: Nothing. //! //! Complexity: Constant. - const_reference front() const + BOOST_INTRUSIVE_FORCEINLINE const_reference front() const BOOST_NOEXCEPT { return *this->priv_value_traits().to_value_ptr(detail::uncast(node_traits::get_next(this->get_root_node()))); } //! Effects: Returns a reference to the last element of the list. @@ -525,7 +525,7 @@ class slist_impl //! //! Note: Does not affect the validity of iterators and references. //! This function is only available is cache_last<> is true. - reference back() + reference back() BOOST_NOEXCEPT { BOOST_STATIC_ASSERT((cache_last)); return *this->priv_value_traits().to_value_ptr(this->get_last_node()); @@ -539,7 +539,7 @@ class slist_impl //! //! Note: Does not affect the validity of iterators and references. //! This function is only available is cache_last<> is true. - const_reference back() const + BOOST_INTRUSIVE_FORCEINLINE const_reference back() const BOOST_NOEXCEPT { BOOST_STATIC_ASSERT((cache_last)); return *this->priv_value_traits().to_value_ptr(this->get_last_node()); @@ -550,7 +550,7 @@ class slist_impl //! Throws: Nothing. //! //! Complexity: Constant. - iterator begin() + BOOST_INTRUSIVE_FORCEINLINE iterator begin() BOOST_NOEXCEPT { return iterator (node_traits::get_next(this->get_root_node()), this->priv_value_traits_ptr()); } //! Effects: Returns a const_iterator to the first element contained in the list. @@ -558,7 +558,7 @@ class slist_impl //! Throws: Nothing. //! //! Complexity: Constant. - const_iterator begin() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator begin() const BOOST_NOEXCEPT { return const_iterator (node_traits::get_next(this->get_root_node()), this->priv_value_traits_ptr()); } //! Effects: Returns a const_iterator to the first element contained in the list. @@ -566,7 +566,7 @@ class slist_impl //! Throws: Nothing. //! //! Complexity: Constant. - const_iterator cbegin() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator cbegin() const BOOST_NOEXCEPT { return const_iterator(node_traits::get_next(this->get_root_node()), this->priv_value_traits_ptr()); } //! Effects: Returns an iterator to the end of the list. @@ -574,7 +574,7 @@ class slist_impl //! Throws: Nothing. //! //! Complexity: Constant. - iterator end() + BOOST_INTRUSIVE_FORCEINLINE iterator end() BOOST_NOEXCEPT { return iterator(this->get_end_node(), this->priv_value_traits_ptr()); } //! Effects: Returns a const_iterator to the end of the list. @@ -582,7 +582,7 @@ class slist_impl //! Throws: Nothing. //! //! Complexity: Constant. - const_iterator end() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator end() const BOOST_NOEXCEPT { return const_iterator(detail::uncast(this->get_end_node()), this->priv_value_traits_ptr()); } //! Effects: Returns a const_iterator to the end of the list. @@ -590,7 +590,7 @@ class slist_impl //! Throws: Nothing. //! //! Complexity: Constant. - const_iterator cend() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator cend() const BOOST_NOEXCEPT { return this->end(); } //! Effects: Returns an iterator that points to a position @@ -599,7 +599,7 @@ class slist_impl //! Throws: Nothing. //! //! Complexity: Constant. - iterator before_begin() + BOOST_INTRUSIVE_FORCEINLINE iterator before_begin() BOOST_NOEXCEPT { return iterator(this->get_root_node(), this->priv_value_traits_ptr()); } //! Effects: Returns an iterator that points to a position @@ -608,7 +608,7 @@ class slist_impl //! Throws: Nothing. //! //! Complexity: Constant. - const_iterator before_begin() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator before_begin() const BOOST_NOEXCEPT { return const_iterator(detail::uncast(this->get_root_node()), this->priv_value_traits_ptr()); } //! Effects: Returns an iterator that points to a position @@ -617,7 +617,7 @@ class slist_impl //! Throws: Nothing. //! //! Complexity: Constant. - const_iterator cbefore_begin() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator cbefore_begin() const BOOST_NOEXCEPT { return this->before_begin(); } //! Effects: Returns an iterator to the last element contained in the list. @@ -627,7 +627,7 @@ class slist_impl //! Complexity: Constant. //! //! Note: This function is present only if cached_last<> option is true. - iterator last() + BOOST_INTRUSIVE_FORCEINLINE iterator last() BOOST_NOEXCEPT { //This function shall not be used if cache_last is not true BOOST_INTRUSIVE_INVARIANT_ASSERT(cache_last); @@ -641,7 +641,7 @@ class slist_impl //! Complexity: Constant. //! //! Note: This function is present only if cached_last<> option is true. - const_iterator last() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator last() const BOOST_NOEXCEPT { //This function shall not be used if cache_last is not true BOOST_INTRUSIVE_INVARIANT_ASSERT(cache_last); @@ -655,7 +655,7 @@ class slist_impl //! Complexity: Constant. //! //! Note: This function is present only if cached_last<> option is true. - const_iterator clast() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator clast() const BOOST_NOEXCEPT { return const_iterator(this->get_last_node(), this->priv_value_traits_ptr()); } //! Precondition: end_iterator must be a valid end iterator @@ -666,7 +666,7 @@ class slist_impl //! Throws: Nothing. //! //! Complexity: Constant. - static slist_impl &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static slist_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return slist_impl::priv_container_from_end_iterator(end_iterator); } //! Precondition: end_iterator must be a valid end const_iterator @@ -677,7 +677,7 @@ class slist_impl //! Throws: Nothing. //! //! Complexity: Constant. - static const slist_impl &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const slist_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return slist_impl::priv_container_from_end_iterator(end_iterator); } //! Effects: Returns the number of the elements contained in the list. @@ -688,9 +688,9 @@ class slist_impl //! if constant_time_size is false. Constant time otherwise. //! //! Note: Does not affect the validity of iterators and references. - size_type size() const + BOOST_INTRUSIVE_FORCEINLINE size_type size() const BOOST_NOEXCEPT { - if(constant_time_size) + BOOST_IF_CONSTEXPR(constant_time_size) return this->priv_size_traits().get_size(); else return node_algorithms::count(this->get_root_node()) - 1; @@ -703,7 +703,7 @@ class slist_impl //! Complexity: Constant. //! //! Note: Does not affect the validity of iterators and references. - bool empty() const + BOOST_INTRUSIVE_FORCEINLINE bool empty() const BOOST_NOEXCEPT { return node_algorithms::unique(this->get_root_node()); } //! Effects: Swaps the elements of x and *this. @@ -716,7 +716,7 @@ class slist_impl //! Note: Does not affect the validity of iterators and references. void swap(slist_impl& other) { - if(cache_last){ + BOOST_IF_CONSTEXPR(cache_last){ priv_swap_cache_last(this, &other); } else{ @@ -734,7 +734,7 @@ class slist_impl //! Complexity: Linear to the number of elements plus the number shifts. //! //! Note: Iterators Does not affect the validity of iterators and references. - void shift_backwards(size_type n = 1) + void shift_backwards(size_type n = 1) BOOST_NOEXCEPT { this->priv_shift_backwards(n, detail::bool_()); } //! Effects: Moves forward all the elements, so that the second @@ -746,7 +746,7 @@ class slist_impl //! Complexity: Linear to the number of elements plus the number shifts. //! //! Note: Does not affect the validity of iterators and references. - void shift_forward(size_type n = 1) + void shift_forward(size_type n = 1) BOOST_NOEXCEPT { this->priv_shift_forward(n, detail::bool_()); } //! Requires: Disposer::operator()(pointer) shouldn't throw. @@ -818,7 +818,7 @@ class slist_impl //! Complexity: Constant. //! //! Note: Does not affect the validity of iterators and references. - iterator insert_after(const_iterator prev_p, reference value) + iterator insert_after(const_iterator prev_p, reference value) BOOST_NOEXCEPT { node_ptr n = priv_value_traits().to_node_ptr(value); BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::inited(n)); @@ -844,7 +844,7 @@ class slist_impl //! //! Note: Does not affect the validity of iterators and references. template - void insert_after(const_iterator prev_p, Iterator f, Iterator l) + void insert_after(const_iterator prev_p, Iterator f, Iterator l) BOOST_NOEXCEPT { //Insert first nodes avoiding cache and size checks size_type count = 0; @@ -859,7 +859,7 @@ class slist_impl if(cache_last && (this->get_last_node() == prev_p.pointed_node())){ this->set_last_node(prev_n); } - if(constant_time_size){ + BOOST_IF_CONSTEXPR(constant_time_size){ this->priv_size_traits().increase(count); } } @@ -876,7 +876,7 @@ class slist_impl //! Constant-time if cache_last<> is true and p == end(). //! //! Note: Does not affect the validity of iterators and references. - iterator insert(const_iterator p, reference value) + iterator insert(const_iterator p, reference value) BOOST_NOEXCEPT { return this->insert_after(this->previous(p), value); } //! Requires: Dereferencing iterator must yield @@ -894,7 +894,7 @@ class slist_impl //! //! Note: Does not affect the validity of iterators and references. template - void insert(const_iterator p, Iterator b, Iterator e) + void insert(const_iterator p, Iterator b, Iterator e) BOOST_NOEXCEPT { return this->insert_after(this->previous(p), b, e); } //! Effects: Erases the element after the element pointed by prev of @@ -909,7 +909,7 @@ class slist_impl //! //! Note: Invalidates the iterators (but not the references) to the //! erased element. - iterator erase_after(const_iterator prev) + iterator erase_after(const_iterator prev) BOOST_NOEXCEPT { return this->erase_after_and_dispose(prev, detail::null_disposer()); } //! Effects: Erases the range (before_f, l) from @@ -925,15 +925,15 @@ class slist_impl //! //! Note: Invalidates the iterators (but not the references) to the //! erased element. - iterator erase_after(const_iterator before_f, const_iterator l) + iterator erase_after(const_iterator before_f, const_iterator l) BOOST_NOEXCEPT { - if(safemode_or_autounlink || constant_time_size){ + BOOST_IF_CONSTEXPR(safemode_or_autounlink || constant_time_size){ return this->erase_after_and_dispose(before_f, l, detail::null_disposer()); } else{ const node_ptr bfp = before_f.pointed_node(); const node_ptr lp = l.pointed_node(); - if(cache_last){ + BOOST_IF_CONSTEXPR(cache_last){ if(lp == this->get_end_node()){ this->set_last_node(bfp); } @@ -957,22 +957,22 @@ class slist_impl //! //! Note: Invalidates the iterators (but not the references) to the //! erased element. - iterator erase_after(const_iterator before_f, const_iterator l, size_type n) + 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); - if(safemode_or_autounlink){ + BOOST_IF_CONSTEXPR(safemode_or_autounlink){ return this->erase_after(before_f, l); } else{ const node_ptr bfp = before_f.pointed_node(); const node_ptr lp = l.pointed_node(); - if(cache_last){ + BOOST_IF_CONSTEXPR(cache_last){ if((lp == this->get_end_node())){ this->set_last_node(bfp); } } node_algorithms::unlink_after(bfp, lp); - if(constant_time_size){ + BOOST_IF_CONSTEXPR(constant_time_size){ this->priv_size_traits().decrease(n); } return l.unconst(); @@ -991,7 +991,7 @@ class slist_impl //! //! Note: Invalidates the iterators (but not the references) to the //! erased element. - iterator erase(const_iterator i) + iterator erase(const_iterator i) BOOST_NOEXCEPT { return this->erase_after(this->previous(i)); } //! Requires: f and l must be valid iterator to elements in *this. @@ -1008,7 +1008,7 @@ class slist_impl //! //! Note: Invalidates the iterators (but not the references) to the //! erased elements. - iterator erase(const_iterator f, const_iterator l) + iterator erase(const_iterator f, const_iterator l) BOOST_NOEXCEPT { return this->erase_after(this->previous(f), l); } //! Effects: Erases the range [f, l) from @@ -1025,7 +1025,7 @@ class slist_impl //! //! Note: Invalidates the iterators (but not the references) to the //! erased element. - iterator erase(const_iterator f, const_iterator l, size_type n) + iterator erase(const_iterator f, const_iterator l, size_type n) BOOST_NOEXCEPT { return this->erase_after(this->previous(f), l, n); } //! Requires: Disposer::operator()(pointer) shouldn't throw. @@ -1043,7 +1043,7 @@ class slist_impl //! //! Note: Invalidates the iterators to the erased element. template - iterator erase_after_and_dispose(const_iterator prev, Disposer disposer) + iterator erase_after_and_dispose(const_iterator prev, Disposer disposer) BOOST_NOEXCEPT { const_iterator it(prev); ++it; @@ -1054,7 +1054,7 @@ class slist_impl if(cache_last && (to_erase == this->get_last_node())){ this->set_last_node(prev_n); } - if(safemode_or_autounlink) + BOOST_IF_CONSTEXPR(safemode_or_autounlink) node_algorithms::init(to_erase); disposer(priv_value_traits().to_value_ptr(to_erase)); this->priv_size_traits().decrement(); @@ -1063,7 +1063,7 @@ class slist_impl /// @cond - static iterator s_insert_after(const_iterator const prev_p, reference value) + static iterator s_insert_after(const_iterator const prev_p, reference value) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT(((!cache_last)&&(!constant_time_size)&&(!stateful_value_traits))); node_ptr const n = value_traits::to_node_ptr(value); @@ -1073,7 +1073,7 @@ class slist_impl } template - static iterator s_erase_after_and_dispose(const_iterator prev, Disposer disposer) + static iterator s_erase_after_and_dispose(const_iterator prev, Disposer disposer) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT(((!cache_last)&&(!constant_time_size)&&(!stateful_value_traits))); const_iterator it(prev); @@ -1082,14 +1082,14 @@ class slist_impl ++it; node_ptr prev_n(prev.pointed_node()); node_algorithms::unlink_after(prev_n); - if(safemode_or_autounlink) + BOOST_IF_CONSTEXPR(safemode_or_autounlink) node_algorithms::init(to_erase); disposer(value_traits::to_value_ptr(to_erase)); return it.unconst(); } template - static iterator s_erase_after_and_dispose(const_iterator before_f, const_iterator l, Disposer disposer) + static iterator s_erase_after_and_dispose(const_iterator before_f, const_iterator l, Disposer disposer) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT(((!cache_last)&&(!constant_time_size)&&(!stateful_value_traits))); node_ptr bfp(before_f.pointed_node()), lp(l.pointed_node()); @@ -1098,14 +1098,14 @@ class slist_impl while(fp != lp){ node_ptr to_erase(fp); fp = node_traits::get_next(fp); - if(safemode_or_autounlink) + BOOST_IF_CONSTEXPR(safemode_or_autounlink) node_algorithms::init(to_erase); disposer(value_traits::to_value_ptr(to_erase)); } return l.unconst(); } - static iterator s_erase_after(const_iterator prev) + static iterator s_erase_after(const_iterator prev) BOOST_NOEXCEPT { return s_erase_after_and_dispose(prev, detail::null_disposer()); } /// @endcond @@ -1125,7 +1125,7 @@ class slist_impl //! //! Note: Invalidates the iterators to the erased element. template - iterator erase_after_and_dispose(const_iterator before_f, const_iterator l, Disposer disposer) + iterator erase_after_and_dispose(const_iterator before_f, const_iterator l, Disposer disposer) BOOST_NOEXCEPT { node_ptr bfp(before_f.pointed_node()), lp(l.pointed_node()); node_ptr fp(node_traits::get_next(bfp)); @@ -1133,7 +1133,7 @@ class slist_impl while(fp != lp){ node_ptr to_erase(fp); fp = node_traits::get_next(fp); - if(safemode_or_autounlink) + BOOST_IF_CONSTEXPR(safemode_or_autounlink) node_algorithms::init(to_erase); disposer(priv_value_traits().to_value_ptr(to_erase)); this->priv_size_traits().decrement(); @@ -1160,12 +1160,12 @@ class slist_impl //! Note: Invalidates the iterators (but not the references) to the //! erased element. template - iterator erase_and_dispose(const_iterator i, Disposer disposer) + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT { return this->erase_after_and_dispose(this->previous(i), disposer); } #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) template - iterator erase_and_dispose(iterator i, Disposer disposer) + iterator erase_and_dispose(iterator i, Disposer disposer) BOOST_NOEXCEPT { return this->erase_and_dispose(const_iterator(i), disposer); } #endif @@ -1187,7 +1187,7 @@ class slist_impl //! Note: Invalidates the iterators (but not the references) to the //! erased elements. template - iterator erase_and_dispose(const_iterator f, const_iterator l, Disposer disposer) + iterator erase_and_dispose(const_iterator f, const_iterator l, Disposer disposer) BOOST_NOEXCEPT { return this->erase_after_and_dispose(this->previous(f), l, disposer); } //! Requires: Dereferencing iterator must yield @@ -1256,7 +1256,7 @@ class slist_impl //! assigned to the last spliced element or prev if x is empty. //! This iterator can be used as new "prev" iterator for a new splice_after call. //! that will splice new values after the previously spliced values. - void splice_after(const_iterator prev, slist_impl &x, const_iterator *l = 0) + void splice_after(const_iterator prev, slist_impl &x, const_iterator *l = 0) BOOST_NOEXCEPT { if(x.empty()){ if(l) *l = prev; @@ -1269,7 +1269,7 @@ class slist_impl const_iterator last_x(x.previous(x.end())); //constant time if cache_last is active node_ptr prev_n(prev.pointed_node()); node_ptr last_x_n(last_x.pointed_node()); - if(cache_last){ + BOOST_IF_CONSTEXPR(cache_last){ x.set_last_node(x.get_root_node()); if(node_traits::get_next(prev_n) == this->get_end_node()){ this->set_last_node(last_x_n); @@ -1295,7 +1295,7 @@ class slist_impl //! //! Note: Iterators of values obtained from list x now point to elements of this //! list. Iterators of this list and all the references are not invalidated. - void splice_after(const_iterator prev_pos, slist_impl &x, const_iterator prev_ele) + void splice_after(const_iterator prev_pos, slist_impl &x, const_iterator prev_ele) BOOST_NOEXCEPT { const_iterator elem = prev_ele; this->splice_after(prev_pos, x, prev_ele, ++elem, 1); @@ -1316,9 +1316,9 @@ class slist_impl //! //! Note: Iterators of values obtained from list x now point to elements of this //! list. Iterators of this list and all the references are not invalidated. - void splice_after(const_iterator prev_pos, slist_impl &x, const_iterator before_f, const_iterator before_l) + void splice_after(const_iterator prev_pos, slist_impl &x, const_iterator before_f, const_iterator before_l) BOOST_NOEXCEPT { - if(constant_time_size) + BOOST_IF_CONSTEXPR(constant_time_size) this->splice_after(prev_pos, x, before_f, before_l, node_algorithms::distance(before_f.pointed_node(), before_l.pointed_node())); else this->priv_splice_after @@ -1339,12 +1339,12 @@ class slist_impl //! //! Note: Iterators of values obtained from list x now point to elements of this //! list. Iterators of this list and all the references are not invalidated. - void splice_after(const_iterator prev_pos, slist_impl &x, const_iterator before_f, const_iterator before_l, size_type n) + 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); this->priv_splice_after (prev_pos.pointed_node(), x, before_f.pointed_node(), before_l.pointed_node()); - if(constant_time_size){ + BOOST_IF_CONSTEXPR(constant_time_size){ this->priv_size_traits().increase(n); x.priv_size_traits().decrease(n); } @@ -1371,7 +1371,7 @@ class slist_impl //! assigned to the last spliced element or prev if x is empty. //! This iterator can be used as new "prev" iterator for a new splice_after call. //! that will splice new values after the previously spliced values. - void splice(const_iterator it, slist_impl &x, const_iterator *l = 0) + void splice(const_iterator it, slist_impl &x, const_iterator *l = 0) BOOST_NOEXCEPT { this->splice_after(this->previous(it), x, l); } //! Requires: it p must be a valid iterator of *this. @@ -1388,7 +1388,7 @@ class slist_impl //! //! Note: Iterators of values obtained from list x now point to elements of this //! list. Iterators of this list and all the references are not invalidated. - void splice(const_iterator pos, slist_impl &x, const_iterator elem) + void splice(const_iterator pos, slist_impl &x, const_iterator elem) BOOST_NOEXCEPT { return this->splice_after(this->previous(pos), x, x.previous(elem)); } //! Requires: pos must be a dereferenceable iterator in *this @@ -1408,7 +1408,7 @@ class slist_impl //! //! Note: Iterators of values obtained from list x now point to elements of this //! list. Iterators of this list and all the references are not invalidated. - void splice(const_iterator pos, slist_impl &x, const_iterator f, const_iterator l) + void splice(const_iterator pos, slist_impl &x, const_iterator f, const_iterator l) BOOST_NOEXCEPT { return this->splice_after(this->previous(pos), x, x.previous(f), x.previous(l)); } //! Requires: pos must be a dereferenceable iterator in *this @@ -1427,7 +1427,7 @@ class slist_impl //! //! Note: Iterators of values obtained from list x now point to elements of this //! list. Iterators of this list and all the references are not invalidated. - void splice(const_iterator pos, slist_impl &x, const_iterator f, const_iterator l, size_type n) + void splice(const_iterator pos, slist_impl &x, const_iterator f, const_iterator l, size_type n) BOOST_NOEXCEPT { return this->splice_after(this->previous(pos), x, x.previous(f), x.previous(l), n); } //! Effects: This function sorts the list *this according to operator<. @@ -1462,7 +1462,7 @@ class slist_impl BOOST_INTRUSIVE_INVARIANT_ASSERT(counter[i].empty()); const_iterator last_element(carry.previous(last_inserted, carry.end())); - if(constant_time_size){ + BOOST_IF_CONSTEXPR(constant_time_size){ counter[i].splice_after( counter[i].cbefore_begin(), carry , carry.cbefore_begin(), last_element , carry.size()); @@ -1479,7 +1479,7 @@ class slist_impl counter[i].merge(counter[i-1], p, &last_inserted); --fill; const_iterator last_element(counter[fill].previous(last_inserted, counter[fill].end())); - if(constant_time_size){ + BOOST_IF_CONSTEXPR(constant_time_size){ this->splice_after( cbefore_begin(), counter[fill], counter[fill].cbefore_begin() , last_element, counter[fill].size()); } @@ -1576,7 +1576,7 @@ class slist_impl //! Complexity: This function is linear to the contained elements. //! //! Note: Iterators and references are not invalidated - void reverse() + void reverse() BOOST_NOEXCEPT { if(cache_last && !this->empty()){ this->set_last_node(node_traits::get_next(this->get_root_node())); @@ -1594,7 +1594,7 @@ class slist_impl //! Note: The relative order of elements that are not removed is unchanged, //! and iterators to elements that are not removed remain valid. This function is //! linear time: it performs exactly size() comparisons for equality. - void remove(const_reference value) + void remove(const_reference value) BOOST_NOEXCEPT { this->remove_if(detail::equal_to_value(value)); } //! Requires: Disposer::operator()(pointer) shouldn't throw. @@ -1609,7 +1609,7 @@ class slist_impl //! Note: The relative order of elements that are not removed is unchanged, //! and iterators to elements that are not removed remain valid. template - void remove_and_dispose(const_reference value, Disposer disposer) + void remove_and_dispose(const_reference value, Disposer disposer) BOOST_NOEXCEPT { this->remove_and_dispose_if(detail::equal_to_value(value), disposer); } //! Effects: Removes all the elements for which a specified @@ -1629,7 +1629,7 @@ class slist_impl node_algorithms::stable_partition (bbeg, this->get_end_node(), detail::key_nodeptr_comp(pred, &this->priv_value_traits()), info); //After cache last is set, slist invariants are preserved... - if(cache_last){ + BOOST_IF_CONSTEXPR(cache_last){ this->set_last_node(info.new_last_node); } //...so erase can be safely called @@ -1658,7 +1658,7 @@ class slist_impl node_algorithms::stable_partition (bbeg, this->get_end_node(), detail::key_nodeptr_comp(pred, &this->priv_value_traits()), info); //After cache last is set, slist invariants are preserved... - if(cache_last){ + BOOST_IF_CONSTEXPR(cache_last){ this->set_last_node(info.new_last_node); } //...so erase can be safely called @@ -1738,7 +1738,7 @@ class slist_impl ++cur; } } - if(cache_last){ + BOOST_IF_CONSTEXPR(cache_last){ this->set_last_node(bcur.pointed_node()); } } @@ -1755,7 +1755,7 @@ class slist_impl //! Note: Iterators and references are not invalidated. //! This static function is available only if the value traits //! is stateless. - static iterator s_iterator_to(reference value) + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT((!stateful_value_traits)); return iterator (value_traits::to_node_ptr(value), const_value_traits_ptr()); @@ -1772,7 +1772,7 @@ class slist_impl //! Note: Iterators and references are not invalidated. //! This static function is available only if the value traits //! is stateless. - static const_iterator s_iterator_to(const_reference value) + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT((!stateful_value_traits)); reference r =*detail::uncast(pointer_traits::pointer_to(value)); @@ -1788,7 +1788,7 @@ class slist_impl //! Complexity: Constant time. //! //! Note: Iterators and references are not invalidated. - iterator iterator_to(reference value) + iterator iterator_to(reference value) BOOST_NOEXCEPT { BOOST_INTRUSIVE_INVARIANT_ASSERT(linear || !node_algorithms::inited(this->priv_value_traits().to_node_ptr(value))); return iterator (this->priv_value_traits().to_node_ptr(value), this->priv_value_traits_ptr()); @@ -1803,7 +1803,7 @@ class slist_impl //! Complexity: Constant time. //! //! Note: Iterators and references are not invalidated. - const_iterator iterator_to(const_reference value) const + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT { reference r =*detail::uncast(pointer_traits::pointer_to(value)); BOOST_INTRUSIVE_INVARIANT_ASSERT (linear || !node_algorithms::inited(this->priv_value_traits().to_node_ptr(r))); @@ -1818,7 +1818,7 @@ class slist_impl //! //! Complexity: Linear to the number of elements before i. //! Constant if cache_last<> is true and i == end(). - iterator previous(iterator i) + iterator previous(iterator i) BOOST_NOEXCEPT { return this->previous(this->cbefore_begin(), i); } //! Returns: The const_iterator to the element before i in the list. @@ -1829,7 +1829,7 @@ class slist_impl //! //! Complexity: Linear to the number of elements before i. //! Constant if cache_last<> is true and i == end(). - const_iterator previous(const_iterator i) const + const_iterator previous(const_iterator i) const BOOST_NOEXCEPT { return this->previous(this->cbefore_begin(), i); } //! Returns: The iterator to the element before i in the list, @@ -1841,7 +1841,7 @@ class slist_impl //! //! Complexity: Linear to the number of elements before i. //! Constant if cache_last<> is true and i == end(). - iterator previous(const_iterator prev_from, iterator i) + iterator previous(const_iterator prev_from, iterator i) BOOST_NOEXCEPT { return this->previous(prev_from, const_iterator(i)).unconst(); } //! Returns: The const_iterator to the element before i in the list, @@ -1853,7 +1853,7 @@ class slist_impl //! //! Complexity: Linear to the number of elements before i. //! Constant if cache_last<> is true and i == end(). - const_iterator previous(const_iterator prev_from, const_iterator i) const + const_iterator previous(const_iterator prev_from, const_iterator i) const BOOST_NOEXCEPT { if(cache_last && (i.pointed_node() == this->get_end_node())){ return const_iterator(detail::uncast(this->get_last_node()), this->priv_value_traits_ptr()); @@ -1881,9 +1881,9 @@ 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) + void incorporate_after(const_iterator prev_pos, const node_ptr & f, const node_ptr & before_l) BOOST_NOEXCEPT { - if(constant_time_size) + 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); else this->priv_incorporate_after(prev_pos.pointed_node(), f, before_l); @@ -1905,7 +1905,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) + void incorporate_after(const_iterator prev_pos, const node_ptr & f, const node_ptr & before_l, size_type n) BOOST_NOEXCEPT { if(n){ BOOST_INTRUSIVE_INVARIANT_ASSERT(n > 0); @@ -1915,7 +1915,7 @@ class slist_impl , iterator(before_l, this->priv_value_traits_ptr()))) +1 == n); this->priv_incorporate_after(prev_pos.pointed_node(), f, before_l); - if(constant_time_size){ + BOOST_IF_CONSTEXPR(constant_time_size){ this->priv_size_traits().increase(n); } } @@ -2006,7 +2006,7 @@ class slist_impl void priv_incorporate_after(node_ptr prev_pos_n, node_ptr first_n, node_ptr before_l_n) { - if(cache_last){ + BOOST_IF_CONSTEXPR(cache_last){ if(prev_pos_n == this->get_last_node()){ this->set_last_node(before_l_n); } @@ -2039,7 +2039,7 @@ class slist_impl (node_traits::get_next(this->get_root_node()), (std::size_t)n)); if(ret.first){ node_traits::set_next(this->get_root_node(), ret.first); - if(cache_last){ + BOOST_IF_CONSTEXPR(cache_last){ this->set_last_node(ret.second); } } @@ -2060,7 +2060,7 @@ class slist_impl (node_traits::get_next(this->get_root_node()), (std::size_t)n)); if(ret.first){ node_traits::set_next(this->get_root_node(), ret.first); - if(cache_last){ + BOOST_IF_CONSTEXPR(cache_last){ this->set_last_node(ret.second); } } @@ -2233,10 +2233,10 @@ class slist BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(slist) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static slist &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static slist &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const slist &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const slist &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } }; diff --git a/include/boost/intrusive/slist_hook.hpp b/include/boost/intrusive/slist_hook.hpp index 0f37772..380818c 100644 --- a/include/boost/intrusive/slist_hook.hpp +++ b/include/boost/intrusive/slist_hook.hpp @@ -97,7 +97,7 @@ class slist_base_hook //! initializes the node to an unlinked state. //! //! Throws: Nothing. - slist_base_hook(); + slist_base_hook() BOOST_NOEXCEPT; //! Effects: If link_mode is \c auto_unlink or \c safe_link //! initializes the node to an unlinked state. The argument is ignored. @@ -108,7 +108,7 @@ class slist_base_hook //! makes classes using the hook STL-compliant without forcing the //! user to do some additional work. \c swap can be used to emulate //! move-semantics. - slist_base_hook(const slist_base_hook& ); + slist_base_hook(const slist_base_hook& ) BOOST_NOEXCEPT; //! Effects: Empty function. The argument is ignored. //! @@ -118,7 +118,7 @@ class slist_base_hook //! makes classes using the hook STL-compliant without forcing the //! user to do some additional work. \c swap can be used to emulate //! move-semantics. - slist_base_hook& operator=(const slist_base_hook& ); + slist_base_hook& operator=(const slist_base_hook& ) BOOST_NOEXCEPT; //! Effects: If link_mode is \c normal_link, the destructor does //! nothing (ie. no code is generated). If link_mode is \c safe_link and the @@ -140,7 +140,7 @@ class slist_base_hook //! Complexity: Constant //! //! Throws: Nothing. - void swap_nodes(slist_base_hook &other); + void swap_nodes(slist_base_hook &other) BOOST_NOEXCEPT; //! Precondition: link_mode must be \c safe_link or \c auto_unlink. //! @@ -148,14 +148,16 @@ class slist_base_hook //! otherwise. This function can be used to test whether \c slist::iterator_to //! will return a valid iterator. //! + //! Throws: Nothing. + //! //! Complexity: Constant - bool is_linked() const; + bool is_linked() const BOOST_NOEXCEPT; //! Effects: Removes the node if it's inserted in a container. //! This function is only allowed if link_mode is \c auto_unlink. //! //! Throws: Nothing. - void unlink(); + void unlink() BOOST_NOEXCEPT; #endif }; diff --git a/include/boost/intrusive/splay_set.hpp b/include/boost/intrusive/splay_set.hpp index 9f6e92e..f700934 100644 --- a/include/boost/intrusive/splay_set.hpp +++ b/include/boost/intrusive/splay_set.hpp @@ -118,61 +118,61 @@ class splay_set_impl ~splay_set_impl(); //! @copydoc ::boost::intrusive::splaytree::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::rbegin() - reverse_iterator rbegin(); + reverse_iterator rbegin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::rbegin()const - const_reverse_iterator rbegin() const; + const_reverse_iterator rbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::crbegin()const - const_reverse_iterator crbegin() const; + const_reverse_iterator crbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::rend() - reverse_iterator rend(); + reverse_iterator rend() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::rend()const - const_reverse_iterator rend() const; + const_reverse_iterator rend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::crend()const - const_reverse_iterator crend() const; + const_reverse_iterator crend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::root() - iterator root(); + iterator root() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::root()const - const_iterator root() const; + const_iterator root() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::croot()const - const_iterator croot() const; + const_iterator croot() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::container_from_end_iterator(iterator) - static splay_set_impl &container_from_end_iterator(iterator end_iterator); + static splay_set_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::container_from_end_iterator(const_iterator) - static const splay_set_impl &container_from_end_iterator(const_iterator end_iterator); + static const splay_set_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::container_from_iterator(iterator) - static splay_set_impl &container_from_iterator(iterator it); + static splay_set_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::container_from_iterator(const_iterator) - static const splay_set_impl &container_from_iterator(const_iterator it); + static const splay_set_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::key_comp()const key_compare key_comp() const; @@ -181,10 +181,10 @@ class splay_set_impl value_compare value_comp() const; //! @copydoc ::boost::intrusive::splaytree::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::swap void swap(splay_set_impl& other); @@ -242,24 +242,24 @@ class splay_set_impl { tree_type::insert_unique(b, e); } //! @copydoc ::boost::intrusive::splaytree::insert_unique_commit - iterator insert_commit(reference value, const insert_commit_data &commit_data) + iterator insert_commit(reference value, const insert_commit_data &commit_data) BOOST_NOEXCEPT { return tree_type::insert_unique_commit(value, commit_data); } #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::splaytree::insert_before - iterator insert_before(const_iterator pos, reference value); + iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::push_back - void push_back(reference value); + void push_back(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::push_front - void push_front(reference value); + void push_front(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::erase(const_iterator) - iterator erase(const_iterator i); + iterator erase(const_iterator i) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::erase(const_iterator,const_iterator) - iterator erase(const_iterator b, const_iterator e); + iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::erase(const key_type &) size_type erase(const key_type &key); @@ -270,11 +270,11 @@ class splay_set_impl //! @copydoc ::boost::intrusive::splaytree::erase_and_dispose(const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator i, Disposer disposer); + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::erase_and_dispose(const_iterator,const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::erase_and_dispose(const key_type &, Disposer) template @@ -285,11 +285,11 @@ class splay_set_impl size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer); //! @copydoc ::boost::intrusive::splaytree::clear - void clear(); + void clear() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::clear_and_dispose template - void clear_and_dispose(Disposer disposer); + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT; #endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED @@ -396,31 +396,31 @@ class splay_set_impl (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const; //! @copydoc ::boost::intrusive::splaytree::s_iterator_to(reference) - static iterator s_iterator_to(reference value); + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::s_iterator_to(const_reference) - static const_iterator s_iterator_to(const_reference value); + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::init_node(reference) - static void init_node(reference value); + static void init_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::unlink_leftmost_without_rebalance - pointer unlink_leftmost_without_rebalance(); + pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::replace_node - void replace_node(iterator replace_this, reference with_this); + void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::remove_node - void remove_node(reference value); + void remove_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::splay_up(iterator) - void splay_up(iterator i); + void splay_up(iterator i) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::splay_down(const KeyType&,KeyTypeKeyCompare) template @@ -430,10 +430,10 @@ class splay_set_impl iterator splay_down(const key_type &key); //! @copydoc ::boost::intrusive::splaytree::rebalance - void rebalance(); + void rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::rebalance_subtree - iterator rebalance_subtree(iterator root); + iterator rebalance_subtree(iterator root) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::merge_unique template @@ -576,16 +576,16 @@ class splay_set BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(splay_set) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static splay_set &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static splay_set &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const splay_set &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const splay_set &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static splay_set &container_from_iterator(iterator it) + BOOST_INTRUSIVE_FORCEINLINE static splay_set &container_from_iterator(iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } - BOOST_INTRUSIVE_FORCEINLINE static const splay_set &container_from_iterator(const_iterator it) + BOOST_INTRUSIVE_FORCEINLINE static const splay_set &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } }; @@ -678,61 +678,61 @@ class splay_multiset_impl ~splay_multiset_impl(); //! @copydoc ::boost::intrusive::splaytree::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::rbegin() - reverse_iterator rbegin(); + reverse_iterator rbegin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::rbegin()const - const_reverse_iterator rbegin() const; + const_reverse_iterator rbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::crbegin()const - const_reverse_iterator crbegin() const; + const_reverse_iterator crbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::rend() - reverse_iterator rend(); + reverse_iterator rend() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::rend()const - const_reverse_iterator rend() const; + const_reverse_iterator rend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::crend()const - const_reverse_iterator crend() const; + const_reverse_iterator crend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::root() - iterator root(); + iterator root() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::root()const - const_iterator root() const; + const_iterator root() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::croot()const - const_iterator croot() const; + const_iterator croot() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::container_from_end_iterator(iterator) - static splay_multiset_impl &container_from_end_iterator(iterator end_iterator); + static splay_multiset_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::container_from_end_iterator(const_iterator) - static const splay_multiset_impl &container_from_end_iterator(const_iterator end_iterator); + static const splay_multiset_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::container_from_iterator(iterator) - static splay_multiset_impl &container_from_iterator(iterator it); + static splay_multiset_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::container_from_iterator(const_iterator) - static const splay_multiset_impl &container_from_iterator(const_iterator it); + static const splay_multiset_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::key_comp()const key_compare key_comp() const; @@ -741,10 +741,10 @@ class splay_multiset_impl value_compare value_comp() const; //! @copydoc ::boost::intrusive::splaytree::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::swap void swap(splay_multiset_impl& other); @@ -779,19 +779,19 @@ class splay_multiset_impl #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::splaytree::insert_before - iterator insert_before(const_iterator pos, reference value); + iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::push_back - void push_back(reference value); + void push_back(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::push_front - void push_front(reference value); + void push_front(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::erase(const_iterator) - iterator erase(const_iterator i); + iterator erase(const_iterator i) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::erase(const_iterator,const_iterator) - iterator erase(const_iterator b, const_iterator e); + iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::erase(const key_type&) size_type erase(const key_type &key); @@ -802,11 +802,11 @@ class splay_multiset_impl //! @copydoc ::boost::intrusive::splaytree::erase_and_dispose(const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator i, Disposer disposer); + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::erase_and_dispose(const_iterator,const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::erase_and_dispose(const key_type&, Disposer) template @@ -817,11 +817,11 @@ class splay_multiset_impl size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer); //! @copydoc ::boost::intrusive::splaytree::clear - void clear(); + void clear() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::clear_and_dispose template - void clear_and_dispose(Disposer disposer); + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::count(const key_type&) size_type count(const key_type&); @@ -907,31 +907,31 @@ class splay_multiset_impl (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const; //! @copydoc ::boost::intrusive::splaytree::s_iterator_to(reference) - static iterator s_iterator_to(reference value); + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::s_iterator_to(const_reference) - static const_iterator s_iterator_to(const_reference value); + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::init_node(reference) - static void init_node(reference value); + static void init_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::unlink_leftmost_without_rebalance - pointer unlink_leftmost_without_rebalance(); + pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::replace_node - void replace_node(iterator replace_this, reference with_this); + void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::remove_node - void remove_node(reference value); + void remove_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::splay_up(iterator) - void splay_up(iterator i); + void splay_up(iterator i) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::splay_down(const KeyType&,KeyTypeKeyCompare) template @@ -941,10 +941,10 @@ class splay_multiset_impl iterator splay_down(const key_type &key); //! @copydoc ::boost::intrusive::splaytree::rebalance - void rebalance(); + void rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::rebalance_subtree - iterator rebalance_subtree(iterator root); + iterator rebalance_subtree(iterator root) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::splaytree::merge_equal template @@ -1087,16 +1087,16 @@ class splay_multiset BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(splay_multiset) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static splay_multiset &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static splay_multiset &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const splay_multiset &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const splay_multiset &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static splay_multiset &container_from_iterator(iterator it) + BOOST_INTRUSIVE_FORCEINLINE static splay_multiset &container_from_iterator(iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } - BOOST_INTRUSIVE_FORCEINLINE static const splay_multiset &container_from_iterator(const_iterator it) + BOOST_INTRUSIVE_FORCEINLINE static const splay_multiset &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } }; diff --git a/include/boost/intrusive/splaytree.hpp b/include/boost/intrusive/splaytree.hpp index a93f1f7..44e5c78 100644 --- a/include/boost/intrusive/splaytree.hpp +++ b/include/boost/intrusive/splaytree.hpp @@ -148,61 +148,61 @@ class splaytree_impl ~splaytree_impl(); //! @copydoc ::boost::intrusive::bstree::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rbegin() - reverse_iterator rbegin(); + reverse_iterator rbegin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rbegin()const - const_reverse_iterator rbegin() const; + const_reverse_iterator rbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::crbegin()const - const_reverse_iterator crbegin() const; + const_reverse_iterator crbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rend() - reverse_iterator rend(); + reverse_iterator rend() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rend()const - const_reverse_iterator rend() const; + const_reverse_iterator rend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::crend()const - const_reverse_iterator crend() const; + const_reverse_iterator crend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::root() - iterator root(); + iterator root() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::root()const - const_iterator root() const; + const_iterator root() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::croot()const - const_iterator croot() const; + const_iterator croot() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(iterator) - static splaytree_impl &container_from_end_iterator(iterator end_iterator); + static splaytree_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(const_iterator) - static const splaytree_impl &container_from_end_iterator(const_iterator end_iterator); + static const splaytree_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_iterator(iterator) - static splaytree_impl &container_from_iterator(iterator it); + static splaytree_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_iterator(const_iterator) - static const splaytree_impl &container_from_iterator(const_iterator it); + static const splaytree_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::key_comp()const key_compare key_comp() const; @@ -211,10 +211,10 @@ class splaytree_impl value_compare value_comp() const; //! @copydoc ::boost::intrusive::bstree::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::swap void swap(splaytree_impl& other); @@ -273,26 +273,26 @@ class splaytree_impl ,KeyTypeKeyCompare comp, insert_commit_data &commit_data); //! @copydoc ::boost::intrusive::bstree::insert_unique_commit - iterator insert_unique_commit(reference value, const insert_commit_data &commit_data); + iterator insert_unique_commit(reference value, const insert_commit_data &commit_data) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::insert_unique(Iterator,Iterator) template void insert_unique(Iterator b, Iterator e); //! @copydoc ::boost::intrusive::bstree::insert_before - iterator insert_before(const_iterator pos, reference value); + iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::push_back - void push_back(reference value); + void push_back(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::push_front - void push_front(reference value); + void push_front(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase(const_iterator) - iterator erase(const_iterator i); + iterator erase(const_iterator i) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase(const_iterator,const_iterator) - iterator erase(const_iterator b, const_iterator e); + iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase(const key_type &) size_type erase(const key_type &key); @@ -303,11 +303,11 @@ class splaytree_impl //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator i, Disposer disposer); + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const key_type &, Disposer) template @@ -318,11 +318,11 @@ class splaytree_impl size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer); //! @copydoc ::boost::intrusive::bstree::clear - void clear(); + void clear() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::clear_and_dispose template - void clear_and_dispose(Disposer disposer); + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::count(const key_type &)const //! Additional note: non-const function, splaying is performed. @@ -440,28 +440,28 @@ class splaytree_impl (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const; //! @copydoc ::boost::intrusive::bstree::s_iterator_to(reference) - static iterator s_iterator_to(reference value); + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::s_iterator_to(const_reference) - static const_iterator s_iterator_to(const_reference value); + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::init_node(reference) - static void init_node(reference value); + static void init_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::unlink_leftmost_without_rebalance - pointer unlink_leftmost_without_rebalance(); + pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::replace_node - void replace_node(iterator replace_this, reference with_this); + void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::remove_node - void remove_node(reference value); + void remove_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::merge_unique(bstree&) template @@ -481,7 +481,7 @@ class splaytree_impl //! Complexity: Amortized logarithmic. //! //! Throws: Nothing. - void splay_up(iterator i) + void splay_up(iterator i) BOOST_NOEXCEPT { return node_algorithms::splay_up(i.pointed_node(), tree_type::header_ptr()); } //! Effects: Rearranges the container so that if *this stores an element @@ -517,10 +517,10 @@ class splaytree_impl #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree::rebalance - void rebalance(); + void rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rebalance_subtree - iterator rebalance_subtree(iterator root); + iterator rebalance_subtree(iterator root) BOOST_NOEXCEPT; friend bool operator< (const splaytree_impl &x, const splaytree_impl &y); @@ -643,16 +643,16 @@ class splaytree BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(splaytree) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static splaytree &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static splaytree &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const splaytree &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const splaytree &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static splaytree &container_from_iterator(iterator it) + BOOST_INTRUSIVE_FORCEINLINE static splaytree &container_from_iterator(iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } - BOOST_INTRUSIVE_FORCEINLINE static const splaytree &container_from_iterator(const_iterator it) + BOOST_INTRUSIVE_FORCEINLINE static const splaytree &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } }; diff --git a/include/boost/intrusive/splaytree_algorithms.hpp b/include/boost/intrusive/splaytree_algorithms.hpp index 6376d32..ce921bb 100644 --- a/include/boost/intrusive/splaytree_algorithms.hpp +++ b/include/boost/intrusive/splaytree_algorithms.hpp @@ -54,7 +54,7 @@ struct splaydown_assemble_and_fix_header { typedef typename NodeTraits::node_ptr node_ptr; - splaydown_assemble_and_fix_header(node_ptr t, node_ptr header, node_ptr leftmost, node_ptr rightmost) + splaydown_assemble_and_fix_header(node_ptr t, node_ptr header, node_ptr leftmost, node_ptr rightmost) BOOST_NOEXCEPT : t_(t) , null_node_(header) , l_(null_node_) @@ -79,7 +79,7 @@ struct splaydown_assemble_and_fix_header private: - void assemble() + void assemble() BOOST_NOEXCEPT { //procedure assemble; // left(r), right(l) := right(t), left(t); @@ -176,58 +176,58 @@ 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); + static node_ptr get_header(const const_node_ptr & n) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::begin_node - static node_ptr begin_node(const const_node_ptr & header); + static node_ptr begin_node(const const_node_ptr & header) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::end_node - static node_ptr end_node(const const_node_ptr & header); + static node_ptr end_node(const 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); //! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr) - static void swap_nodes(node_ptr node1, node_ptr node2); + static void swap_nodes(node_ptr node1, node_ptr node2) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr,node_ptr,node_ptr) - static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2); + static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr) - static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node); + static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr,node_ptr) - static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node); + static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::unlink(node_ptr) - static void unlink(node_ptr node); + static void unlink(node_ptr node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::unlink_leftmost_without_rebalance - static node_ptr unlink_leftmost_without_rebalance(node_ptr header); + 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_node_ptr node); + 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_node_ptr header); + 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(node_ptr node); + 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(node_ptr node); + static node_ptr prev_node(node_ptr node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::init(node_ptr) - static void init(node_ptr node); + static void init(node_ptr node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::init_header(node_ptr) - static void init_header(node_ptr header); + static void init_header(node_ptr header) BOOST_NOEXCEPT; #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree_algorithms::erase(node_ptr,node_ptr) //! Additional notes: the previous node of z is splayed to speed up range deletions. - static void erase(node_ptr header, node_ptr z) + static void erase(node_ptr header, node_ptr z) BOOST_NOEXCEPT { //posibility 1 if(NodeTraits::get_left(z)){ @@ -286,7 +286,7 @@ class splaytree_algorithms //! @copydoc ::boost::intrusive::bstree_algorithms::clear_and_dispose(const node_ptr&,Disposer) template - static void clear_and_dispose(node_ptr header, Disposer disposer); + 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) @@ -459,7 +459,7 @@ class splaytree_algorithms //! @copydoc ::boost::intrusive::bstree_algorithms::insert_before(node_ptr,node_ptr,node_ptr) //! Additional note: the inserted node is splayed static node_ptr insert_before - (node_ptr header, node_ptr pos, node_ptr new_node) + (node_ptr header, node_ptr pos, node_ptr new_node) BOOST_NOEXCEPT { bstree_algo::insert_before(header, pos, new_node); splay_up(new_node, header); @@ -468,7 +468,7 @@ class splaytree_algorithms //! @copydoc ::boost::intrusive::bstree_algorithms::push_back(node_ptr,node_ptr) //! Additional note: the inserted node is splayed - static void push_back(node_ptr header, node_ptr new_node) + static void push_back(node_ptr header, node_ptr new_node) BOOST_NOEXCEPT { bstree_algo::push_back(header, new_node); splay_up(new_node, header); @@ -476,7 +476,7 @@ class splaytree_algorithms //! @copydoc ::boost::intrusive::bstree_algorithms::push_front(node_ptr,node_ptr) //! Additional note: the inserted node is splayed - static void push_front(node_ptr header, node_ptr new_node) + static void push_front(node_ptr header, node_ptr new_node) BOOST_NOEXCEPT { bstree_algo::push_front(header, new_node); splay_up(new_node, header); @@ -507,21 +507,21 @@ class splaytree_algorithms #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_commit(node_ptr,node_ptr,const insert_commit_data&) static void insert_unique_commit - (node_ptr header, node_ptr new_value, const insert_commit_data &commit_data); + (node_ptr header, node_ptr new_value, const insert_commit_data &commit_data) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::is_header - static bool is_header(const_node_ptr p); + static bool is_header(const_node_ptr p) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::rebalance - static void rebalance(node_ptr header); + static void rebalance(node_ptr header) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::rebalance_subtree - static node_ptr rebalance_subtree(node_ptr old_root); + static node_ptr rebalance_subtree(node_ptr old_root) BOOST_NOEXCEPT; #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED // bottom-up splay, use data_ as parent for n | complexity : logarithmic | exception : nothrow - static void splay_up(node_ptr node, node_ptr header) + static void splay_up(node_ptr node, node_ptr header) BOOST_NOEXCEPT { priv_splay_up(node, header); } // top-down splay | complexity : logarithmic | exception : strong, note A @@ -535,7 +535,7 @@ class splaytree_algorithms // bottom-up splay, use data_ as parent for n | complexity : logarithmic | exception : nothrow template - static void priv_splay_up(node_ptr node, node_ptr header) + static void priv_splay_up(node_ptr node, node_ptr header) BOOST_NOEXCEPT { // If (node == header) do a splay for the right most node instead // this is to boost performance of equal_range/count on equivalent containers in the case @@ -660,7 +660,7 @@ class splaytree_algorithms } // break link to left child node and attach it to left tree pointed to by l | complexity : constant | exception : nothrow - static void link_left(node_ptr & t, node_ptr & l) + static void link_left(node_ptr & t, node_ptr & l) BOOST_NOEXCEPT { //procedure link_left; // t, l, right(l) := right(t), t, t @@ -672,7 +672,7 @@ class splaytree_algorithms } // break link to right child node and attach it to right tree pointed to by r | complexity : constant | exception : nothrow - static void link_right(node_ptr & t, node_ptr & r) + static void link_right(node_ptr & t, node_ptr & r) BOOST_NOEXCEPT { //procedure link_right; // t, r, left(r) := left(t), t, t @@ -684,7 +684,7 @@ class splaytree_algorithms } // rotate n with its parent | complexity : constant | exception : nothrow - static void rotate(node_ptr n) + static void rotate(node_ptr n) BOOST_NOEXCEPT { //procedure rotate_left; // t, right(t), left(right(t)) := right(t), left(right(t)), t diff --git a/include/boost/intrusive/treap.hpp b/include/boost/intrusive/treap.hpp index d5e3c0c..ff84b74 100644 --- a/include/boost/intrusive/treap.hpp +++ b/include/boost/intrusive/treap.hpp @@ -232,22 +232,22 @@ class treap_impl ~treap_impl(); //! @copydoc ::boost::intrusive::bstree::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; #endif //! Effects: Returns an iterator pointing to the highest priority object of the treap. @@ -255,7 +255,7 @@ class treap_impl //! Complexity: Constant. //! //! Throws: Nothing. - iterator top() + BOOST_INTRUSIVE_FORCEINLINE iterator top() BOOST_NOEXCEPT { return this->tree_type::root(); } //! Effects: Returns a const_iterator pointing to the highest priority object of the treap.. @@ -263,7 +263,7 @@ class treap_impl //! Complexity: Constant. //! //! Throws: Nothing. - const_iterator top() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator top() const BOOST_NOEXCEPT { return this->ctop(); } //! Effects: Returns a const_iterator pointing to the highest priority object of the treap.. @@ -271,36 +271,36 @@ class treap_impl //! Complexity: Constant. //! //! Throws: Nothing. - const_iterator ctop() const + BOOST_INTRUSIVE_FORCEINLINE const_iterator ctop() const BOOST_NOEXCEPT { return this->tree_type::root(); } #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree::rbegin() - reverse_iterator rbegin(); + reverse_iterator rbegin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rbegin()const - const_reverse_iterator rbegin() const; + const_reverse_iterator rbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::crbegin()const - const_reverse_iterator crbegin() const; + const_reverse_iterator crbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rend() - reverse_iterator rend(); + reverse_iterator rend() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::rend()const - const_reverse_iterator rend() const; + const_reverse_iterator rend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::crend()const - const_reverse_iterator crend() const; + const_reverse_iterator crend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::root() - iterator root(); + iterator root() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::root()const - const_iterator root() const; + const_iterator root() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::croot()const - const_iterator croot() const; + const_iterator croot() const BOOST_NOEXCEPT; #endif @@ -310,7 +310,7 @@ class treap_impl //! Complexity: Constant. //! //! Throws: Nothing. - reverse_iterator rtop() + BOOST_INTRUSIVE_FORCEINLINE reverse_iterator rtop() BOOST_NOEXCEPT { return reverse_iterator(this->top()); } //! Effects: Returns a const_reverse_iterator pointing to the highest priority objec @@ -319,7 +319,7 @@ class treap_impl //! Complexity: Constant. //! //! Throws: Nothing. - const_reverse_iterator rtop() const + BOOST_INTRUSIVE_FORCEINLINE const_reverse_iterator rtop() const BOOST_NOEXCEPT { return const_reverse_iterator(this->top()); } //! Effects: Returns a const_reverse_iterator pointing to the highest priority object @@ -328,21 +328,21 @@ class treap_impl //! Complexity: Constant. //! //! Throws: Nothing. - const_reverse_iterator crtop() const + BOOST_INTRUSIVE_FORCEINLINE const_reverse_iterator crtop() const BOOST_NOEXCEPT { return const_reverse_iterator(this->top()); } #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(iterator) - static treap_impl &container_from_end_iterator(iterator end_iterator); + static treap_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(const_iterator) - static const treap_impl &container_from_end_iterator(const_iterator end_iterator); + static const treap_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_iterator(iterator) - static treap_impl &container_from_iterator(iterator it); + static treap_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::container_from_iterator(const_iterator) - static const treap_impl &container_from_iterator(const_iterator it); + static const treap_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::key_comp()const key_compare key_comp() const; @@ -351,10 +351,10 @@ class treap_impl value_compare value_comp() const; //! @copydoc ::boost::intrusive::bstree::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! Effects: Returns the priority_compare object used by the container. @@ -755,7 +755,7 @@ class treap_impl //! Notes: This function has only sense if a "insert_check" has been //! previously executed to fill "commit_data". No value should be inserted or //! erased between the "insert_check" and "insert_commit" calls. - iterator insert_unique_commit(reference value, const insert_commit_data &commit_data) + iterator insert_unique_commit(reference value, const insert_commit_data &commit_data) BOOST_NOEXCEPT { node_ptr to_insert(this->get_value_traits().to_node_ptr(value)); BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::unique(to_insert)); @@ -778,7 +778,7 @@ class treap_impl //! the successor of "value" container ordering invariant will be broken. //! This is a low-level function to be used only for performance reasons //! by advanced users. - iterator insert_before(const_iterator pos, reference value) + iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT { node_ptr to_insert(this->get_value_traits().to_node_ptr(value)); BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::unique(to_insert)); @@ -808,7 +808,7 @@ class treap_impl //! This function is slightly more efficient than using "insert_before". //! This is a low-level function to be used only for performance reasons //! by advanced users. - void push_back(reference value) + void push_back(reference value) BOOST_NOEXCEPT { node_ptr to_insert(this->get_value_traits().to_node_ptr(value)); BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::unique(to_insert)); @@ -831,7 +831,7 @@ class treap_impl //! This function is slightly more efficient than using "insert_before". //! This is a low-level function to be used only for performance reasons //! by advanced users. - void push_front(reference value) + void push_front(reference value) BOOST_NOEXCEPT { node_ptr to_insert(this->get_value_traits().to_node_ptr(value)); BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::unique(to_insert)); @@ -848,7 +848,7 @@ class treap_impl //! //! Note: Invalidates the iterators (but not the references) //! to the erased elements. No destructors are called. - iterator erase(const_iterator i) + iterator erase(const_iterator i) BOOST_NOEXCEPT { const_iterator ret(i); ++ret; @@ -857,7 +857,7 @@ class treap_impl node_algorithms::erase (this->tree_type::header_ptr(), to_erase, this->prio_node_prio_comp(this->priv_pcomp())); this->tree_type::sz_traits().decrement(); - if(safemode_or_autounlink) + BOOST_IF_CONSTEXPR(safemode_or_autounlink) node_algorithms::init(to_erase); return ret.unconst(); } @@ -871,7 +871,7 @@ class treap_impl //! //! Note: Invalidates the iterators (but not the references) //! to the erased elements. No destructors are called. - iterator erase(const_iterator b, const_iterator e) + iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT { size_type n; return private_erase(b, e, n); } //! Effects: Erases all the elements with the given value. @@ -922,7 +922,7 @@ class treap_impl //! Note: Invalidates the iterators //! to the erased elements. template - iterator erase_and_dispose(const_iterator i, Disposer disposer) + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT { node_ptr to_erase(i.pointed_node()); iterator ret(this->erase(i)); @@ -932,7 +932,7 @@ class treap_impl #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) template - iterator erase_and_dispose(iterator i, Disposer disposer) + iterator erase_and_dispose(iterator i, Disposer disposer) BOOST_NOEXCEPT { return this->erase_and_dispose(const_iterator(i), disposer); } #endif @@ -949,7 +949,7 @@ class treap_impl //! Note: Invalidates the iterators //! to the erased elements. template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT { size_type n; return private_erase(b, e, n, disposer); } //! Requires: Disposer::operator()(pointer) shouldn't throw. @@ -1010,7 +1010,7 @@ class treap_impl //! //! Note: Invalidates the iterators (but not the references) //! to the erased elements. No destructors are called. - void clear() + void clear() BOOST_NOEXCEPT { tree_type::clear(); } //! Effects: Erases all of the elements calling disposer(p) for @@ -1023,7 +1023,7 @@ class treap_impl //! Note: Invalidates the iterators (but not the references) //! to the erased elements. Calls N times to disposer functor. template - void clear_and_dispose(Disposer disposer) + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT { node_algorithms::clear_and_dispose(this->tree_type::header_ptr() , detail::node_disposer(disposer, &this->get_value_traits())); @@ -1180,28 +1180,28 @@ class treap_impl (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const; //! @copydoc ::boost::intrusive::bstree::s_iterator_to(reference) - static iterator s_iterator_to(reference value); + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::s_iterator_to(const_reference) - static const_iterator s_iterator_to(const_reference value); + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::init_node(reference) - static void init_node(reference value); + static void init_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::unlink_leftmost_without_rebalance - pointer unlink_leftmost_without_rebalance(); + pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::replace_node - void replace_node(iterator replace_this, reference with_this); + void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree::remove_node - void remove_node(reference value); + void remove_node(reference value) BOOST_NOEXCEPT; friend bool operator< (const treap_impl &x, const treap_impl &y); @@ -1348,16 +1348,16 @@ class treap BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(treap) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static treap &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static treap &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const treap &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const treap &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static treap &container_from_iterator(iterator it) + BOOST_INTRUSIVE_FORCEINLINE static treap &container_from_iterator(iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } - BOOST_INTRUSIVE_FORCEINLINE static const treap &container_from_iterator(const_iterator it) + BOOST_INTRUSIVE_FORCEINLINE static const treap &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } }; diff --git a/include/boost/intrusive/treap_algorithms.hpp b/include/boost/intrusive/treap_algorithms.hpp index a2a29d2..978bc7c 100644 --- a/include/boost/intrusive/treap_algorithms.hpp +++ b/include/boost/intrusive/treap_algorithms.hpp @@ -179,28 +179,28 @@ class treap_algorithms #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree_algorithms::get_header(const const_node_ptr&) - static node_ptr get_header(const_node_ptr n); + static node_ptr get_header(const_node_ptr n) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::begin_node - static node_ptr begin_node(const_node_ptr header); + static node_ptr begin_node(const_node_ptr header) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::end_node - static node_ptr end_node(const_node_ptr header); + 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); + static void swap_tree(node_ptr header1, node_ptr header2) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr) - static void swap_nodes(node_ptr node1, node_ptr node2); + static void swap_nodes(node_ptr node1, node_ptr node2) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr,node_ptr,node_ptr) - static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2); + static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr) - static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node); + static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr,node_ptr) - static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node); + static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node) BOOST_NOEXCEPT; #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree_algorithms::unlink(node_ptr) @@ -217,25 +217,25 @@ class treap_algorithms #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree_algorithms::unlink_leftmost_without_rebalance - static node_ptr unlink_leftmost_without_rebalance(node_ptr header); + 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_node_ptr node); + 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_node_ptr header); + 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(node_ptr node); + 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(node_ptr node); + static node_ptr prev_node(node_ptr node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::init(node_ptr) - static void init(node_ptr node); + static void init(node_ptr node) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::bstree_algorithms::init_header(node_ptr) - static void init_header(node_ptr header); + static void init_header(node_ptr header) BOOST_NOEXCEPT; #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree_algorithms::erase(node_ptr,node_ptr) @@ -255,7 +255,7 @@ class treap_algorithms //! @copydoc ::boost::intrusive::bstree_algorithms::clear_and_dispose(const node_ptr&,Disposer) template - static void clear_and_dispose(node_ptr header, Disposer disposer); + 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) template @@ -564,7 +564,7 @@ class treap_algorithms //! previously executed to fill "commit_data". No value should be inserted or //! erased between the "insert_check" and "insert_commit" calls. static void insert_unique_commit - (node_ptr header, node_ptr new_node, const insert_commit_data &commit_data) + (node_ptr header, node_ptr new_node, const insert_commit_data &commit_data) BOOST_NOEXCEPT { bstree_algo::insert_unique_commit(header, new_node, commit_data); rotate_up_n(header, new_node, commit_data.rotations); @@ -601,7 +601,7 @@ class treap_algorithms #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::bstree_algorithms::is_header - static bool is_header(const_node_ptr p); + static bool is_header(const_node_ptr p) BOOST_NOEXCEPT; #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED /// @cond diff --git a/include/boost/intrusive/treap_set.hpp b/include/boost/intrusive/treap_set.hpp index 31d0f6a..d15a83b 100644 --- a/include/boost/intrusive/treap_set.hpp +++ b/include/boost/intrusive/treap_set.hpp @@ -126,61 +126,61 @@ class treap_set_impl ~treap_set_impl(); //! @copydoc ::boost::intrusive::treap::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::rbegin() - reverse_iterator rbegin(); + reverse_iterator rbegin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::rbegin()const - const_reverse_iterator rbegin() const; + const_reverse_iterator rbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::crbegin()const - const_reverse_iterator crbegin() const; + const_reverse_iterator crbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::rend() - reverse_iterator rend(); + reverse_iterator rend() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::rend()const - const_reverse_iterator rend() const; + const_reverse_iterator rend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::crend()const - const_reverse_iterator crend() const; + const_reverse_iterator crend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::root() - iterator root(); + iterator root() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::root()const - const_iterator root() const; + const_iterator root() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::croot()const - const_iterator croot() const; + const_iterator croot() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::container_from_end_iterator(iterator) - static treap_set_impl &container_from_end_iterator(iterator end_iterator); + static treap_set_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::container_from_end_iterator(const_iterator) - static const treap_set_impl &container_from_end_iterator(const_iterator end_iterator); + static const treap_set_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::container_from_iterator(iterator) - static treap_set_impl &container_from_iterator(iterator it); + static treap_set_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::container_from_iterator(const_iterator) - static const treap_set_impl &container_from_iterator(const_iterator it); + static const treap_set_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::key_comp()const key_compare key_comp() const; @@ -189,10 +189,10 @@ class treap_set_impl value_compare value_comp() const; //! @copydoc ::boost::intrusive::treap::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::swap void swap(treap_set_impl& other); @@ -215,22 +215,22 @@ class treap_set_impl #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) //! @copydoc ::boost::intrusive::treap::top() - iterator top(); + BOOST_INTRUSIVE_FORCEINLINE iterator top() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::top()const - const_iterator top() const; + BOOST_INTRUSIVE_FORCEINLINE const_iterator top() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::ctop()const - const_iterator ctop() const; + BOOST_INTRUSIVE_FORCEINLINE const_iterator ctop() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::rtop() - reverse_iterator rtop(); + BOOST_INTRUSIVE_FORCEINLINE reverse_iterator rtop() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::rtop()const - const_reverse_iterator rtop() const; + BOOST_INTRUSIVE_FORCEINLINE const_reverse_iterator rtop() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::crtop()const - const_reverse_iterator crtop() const; + BOOST_INTRUSIVE_FORCEINLINE const_reverse_iterator crtop() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::crtop() const priority_compare priority_comp() const; @@ -275,24 +275,24 @@ class treap_set_impl { tree_type::insert_unique(b, e); } //! @copydoc ::boost::intrusive::treap::insert_unique_commit - iterator insert_commit(reference value, const insert_commit_data &commit_data) + iterator insert_commit(reference value, const insert_commit_data &commit_data) BOOST_NOEXCEPT { return tree_type::insert_unique_commit(value, commit_data); } #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::treap::insert_before - iterator insert_before(const_iterator pos, reference value); + iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::push_back - void push_back(reference value); + void push_back(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::push_front - void push_front(reference value); + void push_front(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::erase(const_iterator) - iterator erase(const_iterator i); + iterator erase(const_iterator i) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::erase(const_iterator,const_iterator) - iterator erase(const_iterator b, const_iterator e); + iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::erase(const key_type &) size_type erase(const key_type &key); @@ -303,11 +303,11 @@ class treap_set_impl //! @copydoc ::boost::intrusive::treap::erase_and_dispose(const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator i, Disposer disposer); + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::erase_and_dispose(const_iterator,const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::erase_and_dispose(const key_type &, Disposer) template @@ -318,11 +318,11 @@ class treap_set_impl size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer); //! @copydoc ::boost::intrusive::treap::clear - void clear(); + void clear() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::clear_and_dispose template - void clear_and_dispose(Disposer disposer); + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT; #endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED @@ -422,28 +422,28 @@ class treap_set_impl (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const; //! @copydoc ::boost::intrusive::treap::s_iterator_to(reference) - static iterator s_iterator_to(reference value); + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::s_iterator_to(const_reference) - static const_iterator s_iterator_to(const_reference value); + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::init_node(reference) - static void init_node(reference value); + static void init_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::unlink_leftmost_without_rebalance - pointer unlink_leftmost_without_rebalance(); + pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::replace_node - void replace_node(iterator replace_this, reference with_this); + void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::remove_node - void remove_node(reference value); + void remove_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::merge_unique @@ -575,16 +575,16 @@ class treap_set BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(treap_set) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static treap_set &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static treap_set &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const treap_set &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const treap_set &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static treap_set &container_from_iterator(iterator it) + BOOST_INTRUSIVE_FORCEINLINE static treap_set &container_from_iterator(iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } - BOOST_INTRUSIVE_FORCEINLINE static const treap_set &container_from_iterator(const_iterator it) + BOOST_INTRUSIVE_FORCEINLINE static const treap_set &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } }; @@ -685,61 +685,61 @@ class treap_multiset_impl ~treap_multiset_impl(); //! @copydoc ::boost::intrusive::treap::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::rbegin() - reverse_iterator rbegin(); + reverse_iterator rbegin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::rbegin()const - const_reverse_iterator rbegin() const; + const_reverse_iterator rbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::crbegin()const - const_reverse_iterator crbegin() const; + const_reverse_iterator crbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::rend() - reverse_iterator rend(); + reverse_iterator rend() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::rend()const - const_reverse_iterator rend() const; + const_reverse_iterator rend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::crend()const - const_reverse_iterator crend() const; + const_reverse_iterator crend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::root() - iterator root(); + iterator root() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::root()const - const_iterator root() const; + const_iterator root() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::croot()const - const_iterator croot() const; + const_iterator croot() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::container_from_end_iterator(iterator) - static treap_multiset_impl &container_from_end_iterator(iterator end_iterator); + static treap_multiset_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::container_from_end_iterator(const_iterator) - static const treap_multiset_impl &container_from_end_iterator(const_iterator end_iterator); + static const treap_multiset_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::container_from_iterator(iterator) - static treap_multiset_impl &container_from_iterator(iterator it); + static treap_multiset_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::container_from_iterator(const_iterator) - static const treap_multiset_impl &container_from_iterator(const_iterator it); + static const treap_multiset_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::key_comp()const key_compare key_comp() const; @@ -748,10 +748,10 @@ class treap_multiset_impl value_compare value_comp() const; //! @copydoc ::boost::intrusive::treap::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::swap void swap(treap_multiset_impl& other); @@ -774,22 +774,22 @@ class treap_multiset_impl #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) //! @copydoc ::boost::intrusive::treap::top() - iterator top(); + BOOST_INTRUSIVE_FORCEINLINE iterator top() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::top()const - const_iterator top() const; + BOOST_INTRUSIVE_FORCEINLINE const_iterator top() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::ctop()const - const_iterator ctop() const; + BOOST_INTRUSIVE_FORCEINLINE const_iterator ctop() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::rtop() - reverse_iterator rtop(); + BOOST_INTRUSIVE_FORCEINLINE reverse_iterator rtop() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::rtop()const - const_reverse_iterator rtop() const; + BOOST_INTRUSIVE_FORCEINLINE const_reverse_iterator rtop() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::crtop()const - const_reverse_iterator crtop() const; + BOOST_INTRUSIVE_FORCEINLINE const_reverse_iterator crtop() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::crtop() const priority_compare priority_comp() const; @@ -810,19 +810,19 @@ class treap_multiset_impl #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED //! @copydoc ::boost::intrusive::treap::insert_before - iterator insert_before(const_iterator pos, reference value); + iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::push_back - void push_back(reference value); + void push_back(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::push_front - void push_front(reference value); + void push_front(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::erase(const_iterator) - iterator erase(const_iterator i); + iterator erase(const_iterator i) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::erase(const_iterator,const_iterator) - iterator erase(const_iterator b, const_iterator e); + iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::erase(const key_type &) size_type erase(const key_type &key); @@ -833,11 +833,11 @@ class treap_multiset_impl //! @copydoc ::boost::intrusive::treap::erase_and_dispose(const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator i, Disposer disposer); + iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::erase_and_dispose(const_iterator,const_iterator,Disposer) template - iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); + iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::erase_and_dispose(const key_type &, Disposer) template @@ -848,11 +848,11 @@ class treap_multiset_impl size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer); //! @copydoc ::boost::intrusive::treap::clear - void clear(); + void clear() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::clear_and_dispose template - void clear_and_dispose(Disposer disposer); + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::count(const key_type &)const size_type count(const key_type &key) const; @@ -938,28 +938,28 @@ class treap_multiset_impl (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const; //! @copydoc ::boost::intrusive::treap::s_iterator_to(reference) - static iterator s_iterator_to(reference value); + static iterator s_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::s_iterator_to(const_reference) - static const_iterator s_iterator_to(const_reference value); + static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::init_node(reference) - static void init_node(reference value); + static void init_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::unlink_leftmost_without_rebalance - pointer unlink_leftmost_without_rebalance(); + pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::replace_node - void replace_node(iterator replace_this, reference with_this); + void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::remove_node - void remove_node(reference value); + void remove_node(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::treap::merge_unique template @@ -1090,16 +1090,16 @@ class treap_multiset BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(treap_multiset) src, Cloner cloner, Disposer disposer) { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); } - BOOST_INTRUSIVE_FORCEINLINE static treap_multiset &container_from_end_iterator(iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static treap_multiset &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static const treap_multiset &container_from_end_iterator(const_iterator end_iterator) + BOOST_INTRUSIVE_FORCEINLINE static const treap_multiset &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT { return static_cast(Base::container_from_end_iterator(end_iterator)); } - BOOST_INTRUSIVE_FORCEINLINE static treap_multiset &container_from_iterator(iterator it) + BOOST_INTRUSIVE_FORCEINLINE static treap_multiset &container_from_iterator(iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } - BOOST_INTRUSIVE_FORCEINLINE static const treap_multiset &container_from_iterator(const_iterator it) + BOOST_INTRUSIVE_FORCEINLINE static const treap_multiset &container_from_iterator(const_iterator it) BOOST_NOEXCEPT { return static_cast(Base::container_from_iterator(it)); } }; diff --git a/include/boost/intrusive/trivial_value_traits.hpp b/include/boost/intrusive/trivial_value_traits.hpp index 84fac66..7a28d4c 100644 --- a/include/boost/intrusive/trivial_value_traits.hpp +++ b/include/boost/intrusive/trivial_value_traits.hpp @@ -43,12 +43,14 @@ struct trivial_value_traits typedef node_ptr pointer; typedef const_node_ptr const_pointer; static const link_mode_type link_mode = LinkMode; - BOOST_INTRUSIVE_FORCEINLINE static node_ptr to_node_ptr (value_type &value) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr to_node_ptr (value_type &value) BOOST_NOEXCEPT { return pointer_traits::pointer_to(value); } - BOOST_INTRUSIVE_FORCEINLINE static const_node_ptr to_node_ptr (const value_type &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) { return n; } - BOOST_INTRUSIVE_FORCEINLINE static const const_pointer &to_value_ptr(const const_node_ptr &n) { return n; } + BOOST_INTRUSIVE_FORCEINLINE static const pointer & to_value_ptr(const node_ptr &n) BOOST_NOEXCEPT + { return n; } + BOOST_INTRUSIVE_FORCEINLINE static const const_pointer &to_value_ptr(const const_node_ptr &n) BOOST_NOEXCEPT + { return n; } }; } //namespace intrusive diff --git a/include/boost/intrusive/unordered_set.hpp b/include/boost/intrusive/unordered_set.hpp index 5588cb1..c35d28a 100644 --- a/include/boost/intrusive/unordered_set.hpp +++ b/include/boost/intrusive/unordered_set.hpp @@ -152,22 +152,22 @@ class unordered_set_impl ~unordered_set_impl(); //! @copydoc ::boost::intrusive::hashtable::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::hash_function()const hasher hash_function() const; @@ -176,10 +176,10 @@ class unordered_set_impl key_equal key_eq() const; //! @copydoc ::boost::intrusive::hashtable::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::hashtable void swap(unordered_set_impl& other); @@ -219,7 +219,7 @@ class unordered_set_impl { return table_type::insert_unique_check(key, hasher, key_value_equal, commit_data); } //! @copydoc ::boost::intrusive::hashtable::insert_unique_commit - BOOST_INTRUSIVE_FORCEINLINE iterator insert_commit(reference value, const insert_commit_data &commit_data) + BOOST_INTRUSIVE_FORCEINLINE iterator insert_commit(reference value, const insert_commit_data &commit_data) BOOST_NOEXCEPT { return table_type::insert_unique_commit(value, commit_data); } #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED @@ -228,7 +228,7 @@ class unordered_set_impl void erase(const_iterator i); //! @copydoc ::boost::intrusive::hashtable::erase(const_iterator,const_iterator) - void erase(const_iterator b, const_iterator e); + void erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::erase(const key_type &) size_type erase(const key_type &key); @@ -241,11 +241,11 @@ class unordered_set_impl template BOOST_INTRUSIVE_DOC1ST(void , typename detail::disable_if_convertible::type) - erase_and_dispose(const_iterator i, Disposer disposer); + erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::erase_and_dispose(const_iterator,const_iterator,Disposer) template - void erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); + void erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::erase_and_dispose(const key_type &,Disposer) template @@ -256,11 +256,11 @@ class unordered_set_impl size_type erase_and_dispose(const KeyType& key, KeyHasher hash_func, KeyEqual equal_func, Disposer disposer); //! @copydoc ::boost::intrusive::hashtable::clear - void clear(); + void clear() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::clear_and_dispose template - void clear_and_dispose(Disposer disposer); + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::count(const key_type &)const size_type count(const key_type &key) const; @@ -306,28 +306,28 @@ class unordered_set_impl #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) //! @copydoc ::boost::intrusive::hashtable::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::s_local_iterator_to(reference) - static local_iterator s_local_iterator_to(reference value); + static local_iterator s_local_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::s_local_iterator_to(const_reference) - static const_local_iterator s_local_iterator_to(const_reference value); + static const_local_iterator s_local_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::local_iterator_to(reference) - local_iterator local_iterator_to(reference value); + local_iterator local_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::local_iterator_to(const_reference) - const_local_iterator local_iterator_to(const_reference value) const; + const_local_iterator local_iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::bucket_count - size_type bucket_count() const; + size_type bucket_count() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::bucket_size - size_type bucket_size(size_type n) const; + size_type bucket_size(size_type n) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::bucket(const key_type&)const size_type bucket(const key_type& k) const; @@ -337,25 +337,25 @@ class unordered_set_impl size_type bucket(const KeyType& k, KeyHasher hash_func) const; //! @copydoc ::boost::intrusive::hashtable::bucket_pointer - bucket_ptr bucket_pointer() const; + bucket_ptr bucket_pointer() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::begin(size_type) - local_iterator begin(size_type n); + local_iterator begin(size_type n) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::begin(size_type)const - const_local_iterator begin(size_type n) const; + const_local_iterator begin(size_type n) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::cbegin(size_type)const - const_local_iterator cbegin(size_type n) const; + const_local_iterator cbegin(size_type n) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::end(size_type) - local_iterator end(size_type n); + local_iterator end(size_type n) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::end(size_type)const - const_local_iterator end(size_type n) const; + const_local_iterator end(size_type n) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::cend(size_type)const - const_local_iterator cend(size_type n) const; + const_local_iterator cend(size_type n) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::rehash(const bucket_traits &) void rehash(const bucket_traits &new_bucket_traits); @@ -370,13 +370,13 @@ class unordered_set_impl bool incremental_rehash(const bucket_traits &new_bucket_traits); //! @copydoc ::boost::intrusive::hashtable::split_count - size_type split_count() const; + size_type split_count() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::suggested_upper_bucket_count - static size_type suggested_upper_bucket_count(size_type n); + static size_type suggested_upper_bucket_count(size_type n) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::suggested_lower_bucket_count - static size_type suggested_lower_bucket_count(size_type n); + static size_type suggested_lower_bucket_count(size_type n) BOOST_NOEXCEPT; #endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED @@ -653,22 +653,22 @@ class unordered_multiset_impl ~unordered_multiset_impl(); //! @copydoc ::boost::intrusive::hashtable::begin() - iterator begin(); + iterator begin() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::begin()const - const_iterator begin() const; + const_iterator begin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::cbegin()const - const_iterator cbegin() const; + const_iterator cbegin() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::end() - iterator end(); + iterator end() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::end()const - const_iterator end() const; + const_iterator end() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::cend()const - const_iterator cend() const; + const_iterator cend() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::hash_function()const hasher hash_function() const; @@ -677,10 +677,10 @@ class unordered_multiset_impl key_equal key_eq() const; //! @copydoc ::boost::intrusive::hashtable::empty()const - bool empty() const; + bool empty() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::size()const - size_type size() const; + size_type size() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::hashtable void swap(unordered_multiset_impl& other); @@ -715,7 +715,7 @@ class unordered_multiset_impl void erase(const_iterator i); //! @copydoc ::boost::intrusive::hashtable::erase(const_iterator,const_iterator) - void erase(const_iterator b, const_iterator e); + void erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::erase(const key_type &) size_type erase(const key_type &key); @@ -728,11 +728,11 @@ class unordered_multiset_impl template BOOST_INTRUSIVE_DOC1ST(void , typename detail::disable_if_convertible::type) - erase_and_dispose(const_iterator i, Disposer disposer); + erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::erase_and_dispose(const_iterator,const_iterator,Disposer) template - void erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); + void erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::erase_and_dispose(const key_type &,Disposer) template @@ -743,11 +743,11 @@ class unordered_multiset_impl size_type erase_and_dispose(const KeyType& key, KeyHasher hash_func, KeyEqual equal_func, Disposer disposer); //! @copydoc ::boost::intrusive::hashtable::clear - void clear(); + void clear() BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::clear_and_dispose template - void clear_and_dispose(Disposer disposer); + void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::count(const key_type &)const size_type count(const key_type &key) const; @@ -787,28 +787,28 @@ class unordered_multiset_impl equal_range(const KeyType& key, KeyHasher hash_func, KeyEqual equal_func) const; //! @copydoc ::boost::intrusive::hashtable::iterator_to(reference) - iterator iterator_to(reference value); + iterator iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::iterator_to(const_reference)const - const_iterator iterator_to(const_reference value) const; + const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::s_local_iterator_to(reference) - static local_iterator s_local_iterator_to(reference value); + static local_iterator s_local_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::s_local_iterator_to(const_reference) - static const_local_iterator s_local_iterator_to(const_reference value); + static const_local_iterator s_local_iterator_to(const_reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::local_iterator_to(reference) - local_iterator local_iterator_to(reference value); + local_iterator local_iterator_to(reference value) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::local_iterator_to(const_reference) - const_local_iterator local_iterator_to(const_reference value) const; + const_local_iterator local_iterator_to(const_reference value) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::bucket_count - size_type bucket_count() const; + size_type bucket_count() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::bucket_size - size_type bucket_size(size_type n) const; + size_type bucket_size(size_type n) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::bucket(const key_type&)const size_type bucket(const key_type& k) const; @@ -818,25 +818,25 @@ class unordered_multiset_impl size_type bucket(const KeyType& k, KeyHasher hash_func) const; //! @copydoc ::boost::intrusive::hashtable::bucket_pointer - bucket_ptr bucket_pointer() const; + bucket_ptr bucket_pointer() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::begin(size_type) - local_iterator begin(size_type n); + local_iterator begin(size_type n) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::begin(size_type)const - const_local_iterator begin(size_type n) const; + const_local_iterator begin(size_type n) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::cbegin(size_type)const - const_local_iterator cbegin(size_type n) const; + const_local_iterator cbegin(size_type n) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::end(size_type) - local_iterator end(size_type n); + local_iterator end(size_type n) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::end(size_type)const - const_local_iterator end(size_type n) const; + const_local_iterator end(size_type n) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::cend(size_type)const - const_local_iterator cend(size_type n) const; + const_local_iterator cend(size_type n) const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::rehash(const bucket_traits &) void rehash(const bucket_traits &new_bucket_traits); @@ -851,13 +851,13 @@ class unordered_multiset_impl bool incremental_rehash(const bucket_traits &new_bucket_traits); //! @copydoc ::boost::intrusive::hashtable::split_count - size_type split_count() const; + size_type split_count() const BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::suggested_upper_bucket_count - static size_type suggested_upper_bucket_count(size_type n); + static size_type suggested_upper_bucket_count(size_type n) BOOST_NOEXCEPT; //! @copydoc ::boost::intrusive::hashtable::suggested_lower_bucket_count - static size_type suggested_lower_bucket_count(size_type n); + static size_type suggested_lower_bucket_count(size_type n) BOOST_NOEXCEPT; #endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED }; diff --git a/include/boost/intrusive/unordered_set_hook.hpp b/include/boost/intrusive/unordered_set_hook.hpp index 54a04d3..2fc35ec 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_INTRUSIVE_FORCEINLINE static node_ptr get_next(const 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_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_INTRUSIVE_FORCEINLINE static node_ptr get_prev_in_group(const 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_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_INTRUSIVE_FORCEINLINE static std::size_t get_hash(const 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_INTRUSIVE_FORCEINLINE static void set_hash(const node_ptr & n, std::size_t h) BOOST_NOEXCEPT { n->hash_ = h; } }; @@ -127,19 +127,19 @@ struct unordered_algorithms typedef typename NodeTraits::node_ptr node_ptr; typedef typename NodeTraits::const_node_ptr const_node_ptr; - BOOST_INTRUSIVE_FORCEINLINE static void init(typename base_type::node_ptr n) + BOOST_INTRUSIVE_FORCEINLINE static void init(typename base_type::node_ptr n) BOOST_NOEXCEPT { base_type::init(n); group_algorithms::init(n); } - BOOST_INTRUSIVE_FORCEINLINE static void init_header(typename base_type::node_ptr n) + BOOST_INTRUSIVE_FORCEINLINE static void init_header(typename base_type::node_ptr n) BOOST_NOEXCEPT { base_type::init_header(n); group_algorithms::init_header(n); } - BOOST_INTRUSIVE_FORCEINLINE static void unlink(typename base_type::node_ptr n) + BOOST_INTRUSIVE_FORCEINLINE static void unlink(typename base_type::node_ptr n) BOOST_NOEXCEPT { base_type::unlink(n); group_algorithms::unlink(n); @@ -258,7 +258,7 @@ class unordered_set_base_hook //! initializes the node to an unlinked state. //! //! Throws: Nothing. - unordered_set_base_hook(); + unordered_set_base_hook() BOOST_NOEXCEPT; //! Effects: If link_mode is \c auto_unlink or \c safe_link //! initializes the node to an unlinked state. The argument is ignored. @@ -269,7 +269,7 @@ class unordered_set_base_hook //! makes classes using the hook STL-compliant without forcing the //! user to do some additional work. \c swap can be used to emulate //! move-semantics. - unordered_set_base_hook(const unordered_set_base_hook& ); + unordered_set_base_hook(const unordered_set_base_hook& ) BOOST_NOEXCEPT; //! Effects: Empty function. The argument is ignored. //! @@ -279,7 +279,7 @@ class unordered_set_base_hook //! makes classes using the hook STL-compliant without forcing the //! user to do some additional work. \c swap can be used to emulate //! move-semantics. - unordered_set_base_hook& operator=(const unordered_set_base_hook& ); + unordered_set_base_hook& operator=(const unordered_set_base_hook& ) BOOST_NOEXCEPT; //! Effects: If link_mode is \c normal_link, the destructor does //! nothing (ie. no code is generated). If link_mode is \c safe_link and the @@ -301,7 +301,7 @@ class unordered_set_base_hook //! Complexity: Constant //! //! Throws: Nothing. - void swap_nodes(unordered_set_base_hook &other); + void swap_nodes(unordered_set_base_hook &other) BOOST_NOEXCEPT; //! Precondition: link_mode must be \c safe_link or \c auto_unlink. //! @@ -310,13 +310,13 @@ class unordered_set_base_hook //! will return a valid iterator. //! //! Complexity: Constant - bool is_linked() const; + bool is_linked() const BOOST_NOEXCEPT; //! Effects: Removes the node if it's inserted in a container. //! This function is only allowed if link_mode is \c auto_unlink. //! //! Throws: Nothing. - void unlink(); + void unlink() BOOST_NOEXCEPT; #endif };