File indexing completed on 2025-01-18 09:42:09
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_MULTI_INDEX_DETAIL_VALUE_COMPARE_HPP
0010 #define BOOST_MULTI_INDEX_DETAIL_VALUE_COMPARE_HPP
0011
0012 #if defined(_MSC_VER)
0013 #pragma once
0014 #endif
0015
0016 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
0017 #include <boost/call_traits.hpp>
0018
0019 namespace boost{
0020
0021 namespace multi_index{
0022
0023 namespace detail{
0024
0025 template<typename Value,typename KeyFromValue,typename Compare>
0026 struct value_comparison
0027 {
0028 typedef Value first_argument_type;
0029 typedef Value second_argument_type;
0030 typedef bool result_type;
0031
0032 value_comparison(
0033 const KeyFromValue& key_=KeyFromValue(),const Compare& comp_=Compare()):
0034 key(key_),comp(comp_)
0035 {
0036 }
0037
0038 bool operator()(
0039 typename call_traits<Value>::param_type x,
0040 typename call_traits<Value>::param_type y)const
0041 {
0042 return comp(key(x),key(y));
0043 }
0044
0045 private:
0046 KeyFromValue key;
0047 Compare comp;
0048 };
0049
0050 }
0051
0052 }
0053
0054 }
0055
0056 #endif