annotate DEPENDENCIES/generic/include/boost/multi_index/detail/is_transparent.hpp @ 125:34e428693f5d vext

Vext -> Repoint
author Chris Cannam
date Thu, 14 Jun 2018 11:15:39 +0100
parents f46d142149f5
children
rev   line source
Chris@102 1 /* Copyright 2003-2014 Joaquin M Lopez Munoz.
Chris@102 2 * Distributed under the Boost Software License, Version 1.0.
Chris@102 3 * (See accompanying file LICENSE_1_0.txt or copy at
Chris@102 4 * http://www.boost.org/LICENSE_1_0.txt)
Chris@102 5 *
Chris@102 6 * See http://www.boost.org/libs/multi_index for library home page.
Chris@102 7 */
Chris@102 8
Chris@102 9 #ifndef BOOST_MULTI_INDEX_DETAIL_IS_TRANSPARENT_HPP
Chris@102 10 #define BOOST_MULTI_INDEX_DETAIL_IS_TRANSPARENT_HPP
Chris@102 11
Chris@102 12 #if defined(_MSC_VER)
Chris@102 13 #pragma once
Chris@102 14 #endif
Chris@102 15
Chris@102 16 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
Chris@102 17 #include <boost/mpl/bool.hpp>
Chris@102 18 #include <boost/type_traits/intrinsics.hpp>
Chris@102 19
Chris@102 20 namespace boost{
Chris@102 21
Chris@102 22 namespace multi_index{
Chris@102 23
Chris@102 24 namespace detail{
Chris@102 25
Chris@102 26 /* Metafunction that checks if f(arg,arg2) executes without argument type
Chris@102 27 * conversion. By default (i.e. when it cannot be determined) it evaluates to
Chris@102 28 * true.
Chris@102 29 */
Chris@102 30
Chris@102 31 template<typename F,typename Arg1,typename Arg2,typename=void>
Chris@102 32 struct is_transparent:mpl::true_{};
Chris@102 33
Chris@102 34 } /* namespace multi_index::detail */
Chris@102 35
Chris@102 36 } /* namespace multi_index */
Chris@102 37
Chris@102 38 } /* namespace boost */
Chris@102 39
Chris@102 40 #if !defined(BOOST_NO_SFINAE)&&!defined(BOOST_NO_SFINAE_EXPR)&& \
Chris@102 41 !defined(BOOST_NO_CXX11_DECLTYPE)&& \
Chris@102 42 (defined(BOOST_NO_CXX11_FINAL)||defined(BOOST_IS_FINAL))
Chris@102 43
Chris@102 44 #include <boost/mpl/and.hpp>
Chris@102 45 #include <boost/mpl/not.hpp>
Chris@102 46 #include <boost/mpl/or.hpp>
Chris@102 47 #include <boost/type_traits/function_traits.hpp>
Chris@102 48 #include <boost/type_traits/is_class.hpp>
Chris@102 49 #include <boost/type_traits/is_final.hpp>
Chris@102 50 #include <boost/type_traits/is_function.hpp>
Chris@102 51 #include <boost/type_traits/is_same.hpp>
Chris@102 52 #include <boost/type_traits/remove_pointer.hpp>
Chris@102 53 #include <boost/utility/declval.hpp>
Chris@102 54 #include <boost/utility/enable_if.hpp>
Chris@102 55
Chris@102 56 namespace boost{
Chris@102 57
Chris@102 58 namespace multi_index{
Chris@102 59
Chris@102 60 namespace detail{
Chris@102 61
Chris@102 62 struct not_is_transparent_result_type{};
Chris@102 63
Chris@102 64 template<typename F,typename Arg1,typename Arg2>
Chris@102 65 struct is_transparent_class_helper:F
Chris@102 66 {
Chris@102 67 using F::operator();
Chris@102 68 template<typename T,typename Q>
Chris@102 69 not_is_transparent_result_type operator()(const T&,const Q&)const;
Chris@102 70 };
Chris@102 71
Chris@102 72 template<typename F,typename Arg1,typename Arg2,typename=void>
Chris@102 73 struct is_transparent_class:mpl::true_{};
Chris@102 74
Chris@102 75 template<typename F,typename Arg1,typename Arg2>
Chris@102 76 struct is_transparent_class<
Chris@102 77 F,Arg1,Arg2,
Chris@102 78 typename enable_if<
Chris@102 79 is_same<
Chris@102 80 decltype(
Chris@102 81 declval<const is_transparent_class_helper<F,Arg1,Arg2> >()(
Chris@102 82 declval<const Arg1&>(),declval<const Arg2&>())
Chris@102 83 ),
Chris@102 84 not_is_transparent_result_type
Chris@102 85 >
Chris@102 86 >::type
Chris@102 87 >:mpl::false_{};
Chris@102 88
Chris@102 89 template<typename F,typename Arg1,typename Arg2>
Chris@102 90 struct is_transparent<
Chris@102 91 F,Arg1,Arg2,
Chris@102 92 typename enable_if<
Chris@102 93 mpl::and_<
Chris@102 94 is_class<F>,
Chris@102 95 mpl::not_<is_final<F> > /* is_transparent_class_helper derives from F */
Chris@102 96 >
Chris@102 97 >::type
Chris@102 98 >:is_transparent_class<F,Arg1,Arg2>{};
Chris@102 99
Chris@102 100 template<typename F,typename Arg1,typename Arg2,typename=void>
Chris@102 101 struct is_transparent_function:mpl::true_{};
Chris@102 102
Chris@102 103 template<typename F,typename Arg1,typename Arg2>
Chris@102 104 struct is_transparent_function<
Chris@102 105 F,Arg1,Arg2,
Chris@102 106 typename enable_if<
Chris@102 107 mpl::or_<
Chris@102 108 mpl::not_<mpl::or_<
Chris@102 109 is_same<typename function_traits<F>::arg1_type,const Arg1&>,
Chris@102 110 is_same<typename function_traits<F>::arg1_type,Arg1>
Chris@102 111 > >,
Chris@102 112 mpl::not_<mpl::or_<
Chris@102 113 is_same<typename function_traits<F>::arg2_type,const Arg2&>,
Chris@102 114 is_same<typename function_traits<F>::arg2_type,Arg2>
Chris@102 115 > >
Chris@102 116 >
Chris@102 117 >::type
Chris@102 118 >:mpl::false_{};
Chris@102 119
Chris@102 120 template<typename F,typename Arg1,typename Arg2>
Chris@102 121 struct is_transparent<
Chris@102 122 F,Arg1,Arg2,
Chris@102 123 typename enable_if<
Chris@102 124 is_function<typename remove_pointer<F>::type>
Chris@102 125 >::type
Chris@102 126 >:is_transparent_function<typename remove_pointer<F>::type,Arg1,Arg2>{};
Chris@102 127
Chris@102 128 } /* namespace multi_index::detail */
Chris@102 129
Chris@102 130 } /* namespace multi_index */
Chris@102 131
Chris@102 132 } /* namespace boost */
Chris@102 133
Chris@102 134 #endif
Chris@102 135 #endif