forked from boostorg/intrusive
Updated copyright and fixed trailing whitespaces
[SVN r79435]
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
# Boost Intrusive Library Example Jamfile
|
||||
|
||||
# (C) Copyright Ion Gaztanaga 2006-2007.
|
||||
# (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
# Use, modification and distribution are subject to the
|
||||
# Boost Software License, Version 1.0. (See accompanying file
|
||||
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -26,7 +26,7 @@ struct simple_node
|
||||
class base_1{};
|
||||
class base_2{};
|
||||
|
||||
struct value_1 : public base_1, public simple_node
|
||||
struct value_1 : public base_1, public simple_node
|
||||
{ int id_; };
|
||||
|
||||
struct value_2 : public base_1, public base_2, public simple_node
|
||||
@@ -38,10 +38,10 @@ struct simple_node_traits
|
||||
typedef simple_node node;
|
||||
typedef node * node_ptr;
|
||||
typedef const node * const_node_ptr;
|
||||
static node *get_next(const node *n) { return n->next_; }
|
||||
static void set_next(node *n, node *next) { n->next_ = next; }
|
||||
static node *get_previous(const node *n) { return n->prev_; }
|
||||
static void set_previous(node *n, node *prev) { n->prev_ = prev; }
|
||||
static node *get_next(const node *n) { return n->next_; }
|
||||
static void set_next(node *n, node *next) { n->next_ = next; }
|
||||
static node *get_previous(const node *n) { return n->prev_; }
|
||||
static void set_previous(node *n, node *prev) { n->prev_ = prev; }
|
||||
};
|
||||
|
||||
//A templatized value traits for value_1 and value_2
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -26,17 +26,17 @@ struct simple_node_traits
|
||||
typedef simple_node node;
|
||||
typedef node * node_ptr;
|
||||
typedef const node * const_node_ptr;
|
||||
static node *get_next(const node *n) { return n->next_; }
|
||||
static void set_next(node *n, node *next) { n->next_ = next; }
|
||||
static node *get_previous(const node *n) { return n->prev_; }
|
||||
static void set_previous(node *n, node *prev) { n->prev_ = prev; }
|
||||
static node *get_next(const node *n) { return n->next_; }
|
||||
static void set_next(node *n, node *next) { n->next_ = next; }
|
||||
static node *get_previous(const node *n) { return n->prev_; }
|
||||
static void set_previous(node *n, node *prev) { n->prev_ = prev; }
|
||||
};
|
||||
|
||||
//[doc_advanced_value_traits2_value_traits
|
||||
class base_1{};
|
||||
class base_2{};
|
||||
|
||||
struct value_1 : public base_1, public simple_node
|
||||
struct value_1 : public base_1, public simple_node
|
||||
{
|
||||
int id_;
|
||||
simple_node node_;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2008
|
||||
// (C) Copyright Ion Gaztanaga 2008-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -20,7 +20,7 @@ using namespace boost::intrusive;
|
||||
struct StrHasher
|
||||
{
|
||||
std::size_t operator()(const char *str) const
|
||||
{
|
||||
{
|
||||
std::size_t seed = 0;
|
||||
for(; *str; ++str) boost::hash_combine(seed, *str);
|
||||
return seed;
|
||||
@@ -31,7 +31,7 @@ class Expensive : public set_base_hook<>, public unordered_set_base_hook<>
|
||||
{
|
||||
std::string key_;
|
||||
// Other members...
|
||||
|
||||
|
||||
public:
|
||||
Expensive(const char *key)
|
||||
: key_(key)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -55,7 +55,7 @@ int main()
|
||||
|
||||
BaseSet baseset;
|
||||
MemberMultiset membermultiset;
|
||||
|
||||
|
||||
//Check that size optimization is activated in the base hook
|
||||
assert(sizeof(avl_set_base_hook<optimize_size<true> >) == 3*sizeof(void*));
|
||||
//Check that size optimization is deactivated in the member hook
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007-2009
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -32,13 +32,13 @@ struct my_avltree_node_traits
|
||||
typedef const my_node * const_node_ptr;
|
||||
typedef int balance;
|
||||
|
||||
static node_ptr get_parent(const_node_ptr n) { return n->parent_; }
|
||||
static void set_parent(node_ptr n, node_ptr parent){ n->parent_ = parent; }
|
||||
static node_ptr get_left(const_node_ptr n) { return n->left_; }
|
||||
static void set_left(node_ptr n, node_ptr left) { n->left_ = left; }
|
||||
static node_ptr get_right(const_node_ptr n) { return n->right_; }
|
||||
static void set_right(node_ptr n, node_ptr right) { n->right_ = right; }
|
||||
static balance get_balance(const_node_ptr n) { return n->balance_; }
|
||||
static node_ptr get_parent(const_node_ptr n) { return n->parent_; }
|
||||
static void set_parent(node_ptr n, node_ptr parent){ n->parent_ = parent; }
|
||||
static node_ptr get_left(const_node_ptr n) { return n->left_; }
|
||||
static void set_left(node_ptr n, node_ptr left) { n->left_ = left; }
|
||||
static node_ptr get_right(const_node_ptr n) { return n->right_; }
|
||||
static void set_right(node_ptr n, node_ptr right) { n->right_ = right; }
|
||||
static balance get_balance(const_node_ptr n) { return n->balance_; }
|
||||
static void set_balance(node_ptr n, balance b) { n->balance_ = b; }
|
||||
static balance negative() { return -1; }
|
||||
static balance zero() { return 0; }
|
||||
@@ -72,7 +72,7 @@ int main()
|
||||
|
||||
//Now go to the next node
|
||||
n = algo::next_node(n);
|
||||
assert(n == &three);
|
||||
assert(n == &three);
|
||||
|
||||
//Erase a node just using a pointer to it
|
||||
algo::unlink(&two);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007-2009
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -45,7 +45,7 @@ void clear_list ()
|
||||
{
|
||||
// entity's destructor removes itself from the global list implicitly
|
||||
while (!global_list.empty())
|
||||
delete &global_list.front();
|
||||
delete &global_list.front();
|
||||
}
|
||||
|
||||
int main()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007-2009
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2010-2010
|
||||
// (C) Copyright Ion Gaztanaga 2010-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -25,10 +25,10 @@ struct my_list_node_traits
|
||||
typedef my_node node;
|
||||
typedef my_node * node_ptr;
|
||||
typedef const my_node * const_node_ptr;
|
||||
static node_ptr get_next(const_node_ptr n) { return n->next_; }
|
||||
static void set_next(node_ptr n, node_ptr next) { n->next_ = next; }
|
||||
static node *get_previous(const_node_ptr n) { return n->prev_; }
|
||||
static void set_previous(node_ptr n, node_ptr prev){ n->prev_ = prev; }
|
||||
static node_ptr get_next(const_node_ptr n) { return n->next_; }
|
||||
static void set_next(node_ptr n, node_ptr next) { n->next_ = next; }
|
||||
static node *get_previous(const_node_ptr n) { return n->prev_; }
|
||||
static void set_previous(node_ptr n, node_ptr prev){ n->prev_ = prev; }
|
||||
};
|
||||
|
||||
int main()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2011
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2009-2009
|
||||
// (C) Copyright Ion Gaztanaga 2009-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -31,13 +31,13 @@ struct my_rbtree_node_traits
|
||||
typedef my_node * node_ptr;
|
||||
typedef const my_node * const_node_ptr;
|
||||
typedef int color;
|
||||
static node_ptr get_parent(const_node_ptr n) { return n->parent_; }
|
||||
static void set_parent(node_ptr n, node_ptr parent){ n->parent_ = parent; }
|
||||
static node_ptr get_left(const_node_ptr n) { return n->left_; }
|
||||
static void set_left(node_ptr n, node_ptr left) { n->left_ = left; }
|
||||
static node_ptr get_right(const_node_ptr n) { return n->right_; }
|
||||
static void set_right(node_ptr n, node_ptr right) { n->right_ = right; }
|
||||
static color get_color(const_node_ptr n) { return n->color_; }
|
||||
static node_ptr get_parent(const_node_ptr n) { return n->parent_; }
|
||||
static void set_parent(node_ptr n, node_ptr parent){ n->parent_ = parent; }
|
||||
static node_ptr get_left(const_node_ptr n) { return n->left_; }
|
||||
static void set_left(node_ptr n, node_ptr left) { n->left_ = left; }
|
||||
static node_ptr get_right(const_node_ptr n) { return n->right_; }
|
||||
static void set_right(node_ptr n, node_ptr right) { n->right_ = right; }
|
||||
static color get_color(const_node_ptr n) { return n->color_; }
|
||||
static void set_color(node_ptr n, color c) { n->color_ = c; }
|
||||
static color black() { return color(0); }
|
||||
static color red() { return color(1); }
|
||||
@@ -70,7 +70,7 @@ int main()
|
||||
|
||||
//Now go to the next node
|
||||
n = algo::next_node(n);
|
||||
assert(n == &three);
|
||||
assert(n == &three);
|
||||
|
||||
//Erase a node just using a pointer to it
|
||||
algo::unlink(&two);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2010-2010
|
||||
// (C) Copyright Ion Gaztanaga 2010-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -55,7 +55,7 @@ int main()
|
||||
|
||||
BaseSet baseset;
|
||||
MemberMultiset membermultiset;
|
||||
|
||||
|
||||
//Check that size optimization is activated in the base hook
|
||||
assert(sizeof(set_base_hook<optimize_size<true> >) == 3*sizeof(void*));
|
||||
//Check that size optimization is deactivated in the member hook
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007-2009
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -56,7 +56,7 @@ int main()
|
||||
|
||||
BaseSet baseset;
|
||||
MemberMultiset membermultiset;
|
||||
|
||||
|
||||
//Now insert them in the reverse order in the base hook sg_set
|
||||
for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it){
|
||||
baseset.insert(*it);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -25,8 +25,8 @@ struct my_slist_node_traits
|
||||
typedef my_node node;
|
||||
typedef my_node * node_ptr;
|
||||
typedef const my_node * const_node_ptr;
|
||||
static node_ptr get_next(const_node_ptr n) { return n->next_; }
|
||||
static void set_next(node_ptr n, node_ptr next) { n->next_ = next; }
|
||||
static node_ptr get_next(const_node_ptr n) { return n->next_; }
|
||||
static void set_next(node_ptr n, node_ptr next) { n->next_ = next; }
|
||||
};
|
||||
|
||||
int main()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -31,12 +31,12 @@ struct my_splaytree_node_traits
|
||||
typedef my_node * node_ptr;
|
||||
typedef const my_node * const_node_ptr;
|
||||
|
||||
static node_ptr get_parent(const_node_ptr n) { return n->parent_; }
|
||||
static void set_parent(node_ptr n, node_ptr parent){ n->parent_ = parent; }
|
||||
static node_ptr get_left(const_node_ptr n) { return n->left_; }
|
||||
static void set_left(node_ptr n, node_ptr left) { n->left_ = left; }
|
||||
static node_ptr get_right(const_node_ptr n) { return n->right_; }
|
||||
static void set_right(node_ptr n, node_ptr right) { n->right_ = right; }
|
||||
static node_ptr get_parent(const_node_ptr n) { return n->parent_; }
|
||||
static void set_parent(node_ptr n, node_ptr parent){ n->parent_ = parent; }
|
||||
static node_ptr get_left(const_node_ptr n) { return n->left_; }
|
||||
static void set_left(node_ptr n, node_ptr left) { n->left_ = left; }
|
||||
static node_ptr get_right(const_node_ptr n) { return n->right_; }
|
||||
static void set_right(node_ptr n, node_ptr right) { n->right_ = right; }
|
||||
};
|
||||
|
||||
struct node_ptr_compare
|
||||
@@ -66,7 +66,7 @@ int main()
|
||||
|
||||
//Now go to the next node
|
||||
n = algo::next_node(n);
|
||||
assert(n == &three);
|
||||
assert(n == &three);
|
||||
|
||||
//Erase a node just using a pointer to it
|
||||
algo::unlink(&two);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -20,7 +20,7 @@ using namespace boost::intrusive;
|
||||
class MyClass
|
||||
: public splay_set_base_hook<> //This is an splay tree base hook
|
||||
, public bs_set_base_hook<> //This is a binary search tree base hook
|
||||
|
||||
|
||||
{
|
||||
int int_;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007-2009
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -30,12 +30,12 @@ struct my_splaytree_node_traits
|
||||
typedef my_node * node_ptr;
|
||||
typedef const my_node * const_node_ptr;
|
||||
|
||||
static node_ptr get_parent(const_node_ptr n) { return n->parent_; }
|
||||
static void set_parent(node_ptr n, node_ptr parent){ n->parent_ = parent; }
|
||||
static node_ptr get_left(const_node_ptr n) { return n->left_; }
|
||||
static void set_left(node_ptr n, node_ptr left) { n->left_ = left; }
|
||||
static node_ptr get_right(const_node_ptr n) { return n->right_; }
|
||||
static void set_right(node_ptr n, node_ptr right) { n->right_ = right; }
|
||||
static node_ptr get_parent(const_node_ptr n) { return n->parent_; }
|
||||
static void set_parent(node_ptr n, node_ptr parent){ n->parent_ = parent; }
|
||||
static node_ptr get_left(const_node_ptr n) { return n->left_; }
|
||||
static void set_left(node_ptr n, node_ptr left) { n->left_ = left; }
|
||||
static node_ptr get_right(const_node_ptr n) { return n->right_; }
|
||||
static void set_right(node_ptr n, node_ptr right) { n->right_ = right; }
|
||||
};
|
||||
|
||||
struct node_ptr_compare
|
||||
@@ -65,7 +65,7 @@ int main()
|
||||
|
||||
//Now go to the next node
|
||||
n = algo::next_node(n);
|
||||
assert(n == &three);
|
||||
assert(n == &three);
|
||||
|
||||
//Erase a node just using a pointer to it
|
||||
algo::unlink(&two);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007-2009
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007-2009
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -31,12 +31,12 @@ struct my_treap_node_traits
|
||||
typedef my_node * node_ptr;
|
||||
typedef const my_node * const_node_ptr;
|
||||
|
||||
static node_ptr get_parent(const_node_ptr n) { return n->parent_; }
|
||||
static void set_parent(node_ptr n, node_ptr parent){ n->parent_ = parent; }
|
||||
static node_ptr get_left(const_node_ptr n) { return n->left_; }
|
||||
static void set_left(node_ptr n, node_ptr left) { n->left_ = left; }
|
||||
static node_ptr get_right(const_node_ptr n) { return n->right_; }
|
||||
static void set_right(node_ptr n, node_ptr right) { n->right_ = right; }
|
||||
static node_ptr get_parent(const_node_ptr n) { return n->parent_; }
|
||||
static void set_parent(node_ptr n, node_ptr parent){ n->parent_ = parent; }
|
||||
static node_ptr get_left(const_node_ptr n) { return n->left_; }
|
||||
static void set_left(node_ptr n, node_ptr left) { n->left_ = left; }
|
||||
static node_ptr get_right(const_node_ptr n) { return n->right_; }
|
||||
static void set_right(node_ptr n, node_ptr right) { n->right_ = right; }
|
||||
};
|
||||
|
||||
struct node_ptr_compare
|
||||
@@ -66,7 +66,7 @@ int main()
|
||||
|
||||
//Now go to the next node
|
||||
n = algo::next_node(n);
|
||||
assert(n == &three);
|
||||
assert(n == &three);
|
||||
|
||||
//Erase a node just using a pointer to it
|
||||
algo::unlink(&two, node_ptr_priority());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -70,7 +70,7 @@ int main()
|
||||
|
||||
BaseSet baseset;
|
||||
MemberMultiset membermultiset;
|
||||
|
||||
|
||||
//Now insert them in the sets
|
||||
for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it){
|
||||
baseset.insert(*it);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -39,10 +39,10 @@ struct legacy_node_traits
|
||||
typedef legacy_value * node_ptr;
|
||||
typedef const legacy_value * const_node_ptr;
|
||||
|
||||
static node *get_next(const node *n) { return n->next_; }
|
||||
static void set_next(node *n, node *next) { n->next_ = next; }
|
||||
static node *get_previous(const node *n) { return n->prev_; }
|
||||
static void set_previous(node *n, node *prev) { n->prev_ = prev; }
|
||||
static node *get_next(const node *n) { return n->next_; }
|
||||
static void set_next(node *n, node *next) { n->next_ = next; }
|
||||
static node *get_previous(const node *n) { return n->prev_; }
|
||||
static void set_previous(node *n, node *prev) { n->prev_ = prev; }
|
||||
};
|
||||
|
||||
//This ValueTraits will configure list and slist. In this case,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
Reference in New Issue
Block a user