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