//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: Nothing.
- BOOST_INTRUSIVE_FORCEINLINE static void init(node_ptr this_node)
+ static void init(node_ptr this_node) BOOST_NOEXCEPT
{
const node_ptr null_node = node_ptr();
NodeTraits::set_next(this_node, null_node);
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: Nothing.
- BOOST_INTRUSIVE_FORCEINLINE static bool inited(const const_node_ptr &this_node)
+ BOOST_INTRUSIVE_FORCEINLINE static bool inited(const_node_ptr this_node) BOOST_NOEXCEPT
{ return !NodeTraits::get_next(this_node); }
//! <b>Effects</b>: Constructs an empty list, making this_node the only
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: Nothing.
- BOOST_INTRUSIVE_FORCEINLINE static void init_header(node_ptr this_node)
+ static void init_header(node_ptr this_node) BOOST_NOEXCEPT
{
NodeTraits::set_next(this_node, this_node);
NodeTraits::set_previous(this_node, this_node);
}
-
//! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
//!
//! <b>Effects</b>: Returns true is "this_node" is the only node of a circular list:
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: Nothing.
- BOOST_INTRUSIVE_FORCEINLINE static bool unique(const const_node_ptr &this_node)
+ static bool unique(const_node_ptr this_node) BOOST_NOEXCEPT
{
node_ptr next = NodeTraits::get_next(this_node);
return !next || next == this_node;
//! <b>Complexity</b>: Linear
//!
//! <b>Throws</b>: Nothing.
- static std::size_t count(const const_node_ptr &this_node)
+ static std::size_t count(const_node_ptr this_node) BOOST_NOEXCEPT
{
std::size_t result = 0;
const_node_ptr p = this_node;
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: Nothing.
- BOOST_INTRUSIVE_FORCEINLINE static node_ptr unlink(node_ptr this_node)
+ 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));
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: Nothing.
- BOOST_INTRUSIVE_FORCEINLINE static void unlink(node_ptr b, node_ptr e)
+ static void unlink(node_ptr b, node_ptr e) BOOST_NOEXCEPT
{
if (b != e) {
node_ptr prevb(NodeTraits::get_previous(b));
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: Nothing.
- BOOST_INTRUSIVE_FORCEINLINE static void link_before(node_ptr nxt_node, node_ptr this_node)
+ 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);
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: Nothing.
- BOOST_INTRUSIVE_FORCEINLINE static void link_after(node_ptr prev_node, node_ptr this_node)
+ static void link_after(node_ptr prev_node, node_ptr this_node) BOOST_NOEXCEPT
{
node_ptr next(NodeTraits::get_next(prev_node));
NodeTraits::set_previous(this_node, prev_node);
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: 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;
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: 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) {
+ if (b != e && p != b && p != e) {
node_ptr prev_p(NodeTraits::get_previous(p));
node_ptr prev_b(NodeTraits::get_previous(b));
node_ptr prev_e(NodeTraits::get_previous(e));
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: 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){
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: 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);
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: 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;
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: 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;
//! <b>Complexity</b>: Linear
//!
//! <b>Throws</b>: Nothing.
- static std::size_t distance(const const_node_ptr &f, const const_node_ptr &l)
+ static std::size_t distance(const_node_ptr f, const_node_ptr l) BOOST_NOEXCEPT
{
- const_node_ptr i(f);
std::size_t result = 0;
- while(i != l){
- i = NodeTraits::get_next(i);
+ while(f != l){
+ f = NodeTraits::get_next(f);
++result;
}
return result;
}
private:
- BOOST_INTRUSIVE_FORCEINLINE static void swap_prev(node_ptr this_node, node_ptr other_node)
+ 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)
+ 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));