Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 /* Copyright 2003-2006 Joaquín M López Muñoz.
2 * Distributed under the Boost Software License, Version 1.0.
3 * (See accompanying file LICENSE_1_0.txt or copy at
4 * http://www.boost.org/LICENSE_1_0.txt)
6 * See http://www.boost.org/libs/multi_index for library home page.
9 #ifndef BOOST_MULTI_INDEX_DETAIL_HASH_INDEX_NODE_HPP
10 #define BOOST_MULTI_INDEX_DETAIL_HASH_INDEX_NODE_HPP
12 #if defined(_MSC_VER)&&(_MSC_VER>=1200)
16 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
21 namespace multi_index{
25 /* singly-linked node for use by hashed_index */
27 struct hashed_index_node_impl
29 hashed_index_node_impl*& next(){return next_;}
30 hashed_index_node_impl* next()const{return next_;}
32 /* algorithmic stuff */
34 static void increment(
35 hashed_index_node_impl*& x,
36 hashed_index_node_impl* bbegin,hashed_index_node_impl* bbend)
38 std::less_equal<hashed_index_node_impl*> leq;
41 if(leq(bbegin,x)&&leq(x,bbend)){ /* bucket node */
50 hashed_index_node_impl* x,hashed_index_node_impl* pos)
52 x->next()=pos->next();
56 static void unlink(hashed_index_node_impl* x)
58 hashed_index_node_impl* y=x->next();
59 while(y->next()!=x){y=y->next();}
63 static hashed_index_node_impl* prev(hashed_index_node_impl* x)
65 hashed_index_node_impl* y=x->next();
66 while(y->next()!=x){y=y->next();}
70 static void unlink_next(hashed_index_node_impl* x)
72 x->next()=x->next()->next();
76 hashed_index_node_impl* next_;
79 template<typename Super>
80 struct hashed_index_node_trampoline:hashed_index_node_impl{};
82 template<typename Super>
83 struct hashed_index_node:Super,hashed_index_node_trampoline<Super>
85 hashed_index_node_impl* impl()
86 {return static_cast<impl_type*>(this);}
87 const hashed_index_node_impl* impl()const
88 {return static_cast<const impl_type*>(this);}
90 static hashed_index_node* from_impl(hashed_index_node_impl *x)
91 {return static_cast<hashed_index_node*>(static_cast<impl_type*>(x));}
92 static const hashed_index_node* from_impl(const hashed_index_node_impl* x)
94 return static_cast<const hashed_index_node*>(
95 static_cast<const impl_type*>(x));
98 static void increment(
99 hashed_index_node*& x,
100 hashed_index_node_impl* bbegin,hashed_index_node_impl* bend)
102 hashed_index_node_impl* xi=x->impl();
103 impl_type::increment(xi,bbegin,bend);
108 typedef hashed_index_node_trampoline<Super> impl_type;
111 } /* namespace multi_index::detail */
113 } /* namespace multi_index */
115 } /* namespace boost */