diff --git a/include/boost/intrusive/avltree_algorithms.hpp b/include/boost/intrusive/avltree_algorithms.hpp index e5bcfde..a0bdd77 100644 --- a/include/boost/intrusive/avltree_algorithms.hpp +++ b/include/boost/intrusive/avltree_algorithms.hpp @@ -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 { diff --git a/include/boost/intrusive/detail/key_nodeptr_comp.hpp b/include/boost/intrusive/detail/key_nodeptr_comp.hpp index 790ce72..bf7810b 100644 --- a/include/boost/intrusive/detail/key_nodeptr_comp.hpp +++ b/include/boost/intrusive/detail/key_nodeptr_comp.hpp @@ -44,6 +44,7 @@ struct key_nodeptr_comp static const bool value = is_same::value || is_same::value; }; + //key_forward template const value_type & key_forward (const T &node, typename enable_if_c::value>::type * = 0) const @@ -53,13 +54,23 @@ struct key_nodeptr_comp const T & key_forward(const T &key, typename enable_if_c::value>::type* = 0) const { return key; } + //operator() 1 arg + template + bool operator()(const KeyType &key1) const + { return base_t::get()(this->key_forward(key1)); } + + template + bool operator()(const KeyType &key1) + { return base_t::get()(this->key_forward(key1)); } + + //operator() 2 arg template bool operator()(const KeyType &key1, const KeyType2 &key2) const { return base_t::get()(this->key_forward(key1), this->key_forward(key2)); } - template - bool operator()(const KeyType &key1) const - { return base_t::get()(this->key_forward(key1)); } + template + bool operator()(const KeyType &key1, const KeyType2 &key2) + { return base_t::get()(this->key_forward(key1), this->key_forward(key2)); } const ValueTraits *const traits_; };