File indexing completed on 2025-01-18 09:42:07
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_MULTI_INDEX_DETAIL_ORD_INDEX_ARGS_HPP
0010 #define BOOST_MULTI_INDEX_DETAIL_ORD_INDEX_ARGS_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/mpl/aux_/na.hpp>
0018 #include <boost/mpl/eval_if.hpp>
0019 #include <boost/mpl/identity.hpp>
0020 #include <boost/mpl/if.hpp>
0021 #include <boost/multi_index/tag.hpp>
0022 #include <boost/static_assert.hpp>
0023 #include <boost/type_traits/is_same.hpp>
0024 #include <functional>
0025
0026 namespace boost{
0027
0028 namespace multi_index{
0029
0030 namespace detail{
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043 template<typename KeyFromValue>
0044 struct index_args_default_compare
0045 {
0046 typedef std::less<typename KeyFromValue::result_type> type;
0047 };
0048
0049 template<typename Arg1,typename Arg2,typename Arg3>
0050 struct ordered_index_args
0051 {
0052 typedef is_tag<Arg1> full_form;
0053
0054 typedef typename mpl::if_<
0055 full_form,
0056 Arg1,
0057 tag< > >::type tag_list_type;
0058 typedef typename mpl::if_<
0059 full_form,
0060 Arg2,
0061 Arg1>::type key_from_value_type;
0062 typedef typename mpl::if_<
0063 full_form,
0064 Arg3,
0065 Arg2>::type supplied_compare_type;
0066 typedef typename mpl::eval_if<
0067 mpl::is_na<supplied_compare_type>,
0068 index_args_default_compare<key_from_value_type>,
0069 mpl::identity<supplied_compare_type>
0070 >::type compare_type;
0071
0072 BOOST_STATIC_ASSERT(is_tag<tag_list_type>::value);
0073 BOOST_STATIC_ASSERT(!mpl::is_na<key_from_value_type>::value);
0074 BOOST_STATIC_ASSERT(!mpl::is_na<compare_type>::value);
0075 };
0076
0077 }
0078
0079 }
0080
0081 }
0082
0083 #endif