////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2015-2015. Distributed under 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) // // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// #ifndef BOOST_INTRUSIVE_DETAIL_TREE_VALUE_COMPARE_HPP #define BOOST_INTRUSIVE_DETAIL_TREE_VALUE_COMPARE_HPP #ifndef BOOST_CONFIG_HPP # include #endif #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif #include #include namespace boost{ namespace intrusive{ template struct tree_value_compare : public boost::intrusive::detail::ebo_functor_holder { typedef boost::intrusive::detail::ebo_functor_holder base_t; typedef T value_type; typedef KeyCompare key_compare; typedef KeyOfValue key_of_value; typedef Key key_type; explicit tree_value_compare(const key_compare &kcomp) : base_t(kcomp) {} tree_value_compare() : base_t() {} const key_compare &key_comp() const { return static_cast(*this); } key_compare &key_comp() { return static_cast(*this); } template struct is_key : boost::intrusive::detail::is_same {}; template typename boost::intrusive::detail::enable_if, const key_type &>::type key_forward(const U &key) const { return key; } template typename boost::intrusive::detail::disable_if, const key_type &>::type key_forward(const U &key) const { return KeyOfValue()(key); } template bool operator()(const KeyType &key1, const KeyType2 &key2) const { return key_compare::operator()(this->key_forward(key1), this->key_forward(key2)); } template bool operator()(const KeyType &key1, const KeyType2 &key2) { return key_compare::operator()(this->key_forward(key1), this->key_forward(key2)); } }; } //namespace intrusive{ } //namespace boost{ #endif //#ifdef BOOST_INTRUSIVE_DETAIL_TREE_VALUE_COMPARE_HPP