Chris@102: /* Copyright 2003-2014 Joaquin M Lopez Munoz. Chris@102: * Distributed under the Boost Software License, Version 1.0. Chris@102: * (See accompanying file LICENSE_1_0.txt or copy at Chris@102: * http://www.boost.org/LICENSE_1_0.txt) Chris@102: * Chris@102: * See http://www.boost.org/libs/multi_index for library home page. Chris@102: */ Chris@102: Chris@102: #ifndef BOOST_MULTI_INDEX_DETAIL_IS_TRANSPARENT_HPP Chris@102: #define BOOST_MULTI_INDEX_DETAIL_IS_TRANSPARENT_HPP Chris@102: Chris@102: #if defined(_MSC_VER) Chris@102: #pragma once Chris@102: #endif Chris@102: Chris@102: #include /* keep it first to prevent nasty warns in MSVC */ Chris@102: #include Chris@102: #include Chris@102: Chris@102: namespace boost{ Chris@102: Chris@102: namespace multi_index{ Chris@102: Chris@102: namespace detail{ Chris@102: Chris@102: /* Metafunction that checks if f(arg,arg2) executes without argument type Chris@102: * conversion. By default (i.e. when it cannot be determined) it evaluates to Chris@102: * true. Chris@102: */ Chris@102: Chris@102: template Chris@102: struct is_transparent:mpl::true_{}; Chris@102: Chris@102: } /* namespace multi_index::detail */ Chris@102: Chris@102: } /* namespace multi_index */ Chris@102: Chris@102: } /* namespace boost */ Chris@102: Chris@102: #if !defined(BOOST_NO_SFINAE)&&!defined(BOOST_NO_SFINAE_EXPR)&& \ Chris@102: !defined(BOOST_NO_CXX11_DECLTYPE)&& \ Chris@102: (defined(BOOST_NO_CXX11_FINAL)||defined(BOOST_IS_FINAL)) Chris@102: Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: Chris@102: namespace boost{ Chris@102: Chris@102: namespace multi_index{ Chris@102: Chris@102: namespace detail{ Chris@102: Chris@102: struct not_is_transparent_result_type{}; Chris@102: Chris@102: template Chris@102: struct is_transparent_class_helper:F Chris@102: { Chris@102: using F::operator(); Chris@102: template Chris@102: not_is_transparent_result_type operator()(const T&,const Q&)const; Chris@102: }; Chris@102: Chris@102: template Chris@102: struct is_transparent_class:mpl::true_{}; Chris@102: Chris@102: template Chris@102: struct is_transparent_class< Chris@102: F,Arg1,Arg2, Chris@102: typename enable_if< Chris@102: is_same< Chris@102: decltype( Chris@102: declval >()( Chris@102: declval(),declval()) Chris@102: ), Chris@102: not_is_transparent_result_type Chris@102: > Chris@102: >::type Chris@102: >:mpl::false_{}; Chris@102: Chris@102: template Chris@102: struct is_transparent< Chris@102: F,Arg1,Arg2, Chris@102: typename enable_if< Chris@102: mpl::and_< Chris@102: is_class, Chris@102: mpl::not_ > /* is_transparent_class_helper derives from F */ Chris@102: > Chris@102: >::type Chris@102: >:is_transparent_class{}; Chris@102: Chris@102: template Chris@102: struct is_transparent_function:mpl::true_{}; Chris@102: Chris@102: template Chris@102: struct is_transparent_function< Chris@102: F,Arg1,Arg2, Chris@102: typename enable_if< Chris@102: mpl::or_< Chris@102: mpl::not_::arg1_type,const Arg1&>, Chris@102: is_same::arg1_type,Arg1> Chris@102: > >, Chris@102: mpl::not_::arg2_type,const Arg2&>, Chris@102: is_same::arg2_type,Arg2> Chris@102: > > Chris@102: > Chris@102: >::type Chris@102: >:mpl::false_{}; Chris@102: Chris@102: template Chris@102: struct is_transparent< Chris@102: F,Arg1,Arg2, Chris@102: typename enable_if< Chris@102: is_function::type> Chris@102: >::type Chris@102: >:is_transparent_function::type,Arg1,Arg2>{}; Chris@102: Chris@102: } /* namespace multi_index::detail */ Chris@102: Chris@102: } /* namespace multi_index */ Chris@102: Chris@102: } /* namespace boost */ Chris@102: Chris@102: #endif Chris@102: #endif