Chris@101: /* Copyright 2003-2013 Joaquin M Lopez Munoz. Chris@16: * Distributed under the Boost Software License, Version 1.0. Chris@16: * (See accompanying file LICENSE_1_0.txt or copy at Chris@16: * http://www.boost.org/LICENSE_1_0.txt) Chris@16: * Chris@16: * See http://www.boost.org/libs/multi_index for library home page. Chris@16: */ Chris@16: Chris@16: #ifndef BOOST_MULTI_INDEX_DETAIL_VALUE_COMPARE_HPP Chris@16: #define BOOST_MULTI_INDEX_DETAIL_VALUE_COMPARE_HPP Chris@16: Chris@101: #if defined(_MSC_VER) Chris@16: #pragma once Chris@16: #endif Chris@16: Chris@16: #include /* keep it first to prevent nasty warns in MSVC */ Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost{ Chris@16: Chris@16: namespace multi_index{ Chris@16: Chris@16: namespace detail{ Chris@16: Chris@16: template Chris@16: struct value_comparison:std::binary_function Chris@16: { Chris@16: value_comparison( Chris@16: const KeyFromValue& key_=KeyFromValue(),const Compare& comp_=Compare()): Chris@16: key(key_),comp(comp_) Chris@16: { Chris@16: } Chris@16: Chris@16: bool operator()( Chris@16: typename call_traits::param_type x, Chris@16: typename call_traits::param_type y)const Chris@16: { Chris@16: return comp(key(x),key(y)); Chris@16: } Chris@16: Chris@16: private: Chris@16: KeyFromValue key; Chris@16: Compare comp; Chris@16: }; Chris@16: Chris@16: } /* namespace multi_index::detail */ Chris@16: Chris@16: } /* namespace multi_index */ Chris@16: Chris@16: } /* namespace boost */ Chris@16: Chris@16: #endif