Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:42:08

0001 /* Copyright 2003-2017 Joaquin M Lopez Munoz.
0002  * Distributed under the Boost Software License, Version 1.0.
0003  * (See accompanying file LICENSE_1_0.txt or copy at
0004  * http://www.boost.org/LICENSE_1_0.txt)
0005  *
0006  * See http://www.boost.org/libs/multi_index for library home page.
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 /* Metafunctions to check if f(arg1,arg2) promotes either arg1 to the type of
0020  * arg2 or viceversa. By default, (i.e. if it cannot be determined), no
0021  * promotion is assumed.
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 } /* namespace multi_index::detail */
0039 
0040 } /* namespace multi_index */
0041 
0042 } /* namespace boost */
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 } /* namespace multi_index::detail */
0077 
0078 } /* namespace multi_index */
0079 
0080 } /* namespace boost */
0081 
0082 #endif
0083 #endif