File indexing completed on 2025-01-18 09:42:08
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_MULTI_INDEX_DETAIL_PROMOTES_ARG_HPP
0010 #define BOOST_MULTI_INDEX_DETAIL_PROMOTES_ARG_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/detail/workaround.hpp>
0018
0019
0020
0021
0022
0023
0024 #if BOOST_WORKAROUND(BOOST_MSVC,<1400)
0025
0026 namespace boost{
0027
0028 namespace multi_index{
0029
0030 namespace detail{
0031
0032 template<typename F,typename Arg1,typename Arg2>
0033 struct promotes_1st_arg:mpl::false_{};
0034
0035 template<typename F,typename Arg1,typename Arg2>
0036 struct promotes_2nd_arg:mpl::false_{};
0037
0038 }
0039
0040 }
0041
0042 }
0043
0044 #else
0045
0046 #include <boost/mpl/and.hpp>
0047 #include <boost/mpl/bool.hpp>
0048 #include <boost/mpl/not.hpp>
0049 #include <boost/multi_index/detail/is_transparent.hpp>
0050 #include <boost/type_traits/is_convertible.hpp>
0051
0052 namespace boost{
0053
0054 namespace multi_index{
0055
0056 namespace detail{
0057
0058 template<typename F,typename Arg1,typename Arg2>
0059 struct promotes_1st_arg:
0060 mpl::and_<
0061 mpl::not_<is_transparent<F,Arg1,Arg2> >,
0062 is_convertible<const Arg1,Arg2>,
0063 is_transparent<F,Arg2,Arg2>
0064 >
0065 {};
0066
0067 template<typename F,typename Arg1,typename Arg2>
0068 struct promotes_2nd_arg:
0069 mpl::and_<
0070 mpl::not_<is_transparent<F,Arg1,Arg2> >,
0071 is_convertible<const Arg2,Arg1>,
0072 is_transparent<F,Arg1,Arg1>
0073 >
0074 {};
0075
0076 }
0077
0078 }
0079
0080 }
0081
0082 #endif
0083 #endif