mirror of
https://github.com/boostorg/intrusive.git
synced 2025-08-03 14:34:44 +02:00
Added missing non-const overloads to operator()
This commit is contained in:
@@ -50,6 +50,13 @@ struct avltree_node_cloner
|
||||
NodeTraits::set_balance(n, NodeTraits::get_balance(p));
|
||||
return n;
|
||||
}
|
||||
|
||||
node_ptr operator()(const node_ptr & p) const
|
||||
{
|
||||
node_ptr n = base_t::get()(p);
|
||||
NodeTraits::set_balance(n, NodeTraits::get_balance(p));
|
||||
return n;
|
||||
}
|
||||
};
|
||||
|
||||
namespace detail {
|
||||
|
@@ -44,6 +44,7 @@ struct key_nodeptr_comp
|
||||
static const bool value = is_same<T, const_node_ptr>::value || is_same<T, node_ptr>::value;
|
||||
};
|
||||
|
||||
//key_forward
|
||||
template<class T>
|
||||
const value_type & key_forward
|
||||
(const T &node, typename enable_if_c<is_node_ptr<T>::value>::type * = 0) const
|
||||
@@ -53,13 +54,23 @@ struct key_nodeptr_comp
|
||||
const T & key_forward(const T &key, typename enable_if_c<!is_node_ptr<T>::value>::type* = 0) const
|
||||
{ return key; }
|
||||
|
||||
//operator() 1 arg
|
||||
template<class KeyType>
|
||||
bool operator()(const KeyType &key1) const
|
||||
{ return base_t::get()(this->key_forward(key1)); }
|
||||
|
||||
template<class KeyType>
|
||||
bool operator()(const KeyType &key1)
|
||||
{ return base_t::get()(this->key_forward(key1)); }
|
||||
|
||||
//operator() 2 arg
|
||||
template<class KeyType, class KeyType2>
|
||||
bool operator()(const KeyType &key1, const KeyType2 &key2) const
|
||||
{ return base_t::get()(this->key_forward(key1), this->key_forward(key2)); }
|
||||
|
||||
template<class KeyType>
|
||||
bool operator()(const KeyType &key1) const
|
||||
{ return base_t::get()(this->key_forward(key1)); }
|
||||
template<class KeyType, class KeyType2>
|
||||
bool operator()(const KeyType &key1, const KeyType2 &key2)
|
||||
{ return base_t::get()(this->key_forward(key1), this->key_forward(key2)); }
|
||||
|
||||
const ValueTraits *const traits_;
|
||||
};
|
||||
|
Reference in New Issue
Block a user