36 #ifndef BOOST_MULTI_INDEX_DETAIL_ORD_INDEX_OPS_HPP
37 #define BOOST_MULTI_INDEX_DETAIL_ORD_INDEX_OPS_HPP
50 namespace multi_index{
62 typename Node,
typename KeyFromValue,
63 typename CompatibleKey,
typename CompatibleCompare
66 Node* top,Node* y,
const KeyFromValue& key,
const CompatibleKey& x,
67 const CompatibleCompare& comp)
79 typename Node,
typename KeyFromValue,
80 typename CompatibleCompare
83 Node* top,Node* y,
const KeyFromValue& key,
91 typename Node,
typename KeyFromValue,
92 typename CompatibleKey,
typename CompatibleCompare
95 Node* top,Node* y,
const KeyFromValue& key,
const CompatibleKey& x,
101 if(!comp(key(top->value()),x)){
103 top=Node::from_impl(top->left());
105 else top=Node::from_impl(top->right());
108 return (y==y0||comp(x,key(y->value())))?y0:y;
112 typename Node,
typename KeyFromValue,
113 typename CompatibleKey,
typename CompatibleCompare
116 Node* top,Node* y,
const KeyFromValue& key,
const CompatibleKey& x,
117 const CompatibleCompare& comp)
127 typename Node,
typename KeyFromValue,
128 typename CompatibleCompare
131 Node* top,Node* y,
const KeyFromValue& key,
139 typename Node,
typename KeyFromValue,
140 typename CompatibleKey,
typename CompatibleCompare
143 Node* top,Node* y,
const KeyFromValue& key,
const CompatibleKey& x,
147 if(!comp(key(top->value()),x)){
149 top=Node::from_impl(top->left());
151 else top=Node::from_impl(top->right());
158 typename Node,
typename KeyFromValue,
159 typename CompatibleKey,
typename CompatibleCompare
162 Node* top,Node* y,
const KeyFromValue& key,
const CompatibleKey& x,
163 const CompatibleCompare& comp)
173 typename Node,
typename KeyFromValue,
174 typename CompatibleCompare
177 Node* top,Node* y,
const KeyFromValue& key,
185 typename Node,
typename KeyFromValue,
186 typename CompatibleKey,
typename CompatibleCompare
189 Node* top,Node* y,
const KeyFromValue& key,
const CompatibleKey& x,
193 if(comp(x,key(top->value()))){
195 top=Node::from_impl(top->left());
197 else top=Node::from_impl(top->right());
204 typename Node,
typename KeyFromValue,
205 typename CompatibleKey,
typename CompatibleCompare
208 Node* top,Node* y,
const KeyFromValue& key,
const CompatibleKey& x,
209 const CompatibleCompare& comp)
221 typename Node,
typename KeyFromValue,
222 typename CompatibleCompare
225 Node* top,Node* y,
const KeyFromValue& key,
233 typename Node,
typename KeyFromValue,
234 typename CompatibleKey,
typename CompatibleCompare
237 Node* top,Node* y,
const KeyFromValue& key,
const CompatibleKey& x,
241 if(comp(key(top->value()),x)){
242 top=Node::from_impl(top->right());
244 else if(comp(x,key(top->value()))){
246 top=Node::from_impl(top->left());
249 return std::pair<Node*,Node*>(
251 Node::from_impl(top->left()),top,key,x,comp,
mpl::false_()),
253 Node::from_impl(top->right()),y,key,x,comp,
mpl::false_()));
257 return std::pair<Node*,Node*>(y,y);