![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/include/boost/convert/detail/ |
Upload File : |
// Copyright (c) 2009-2016 Vladimir Batov. // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. See http://www.boost.org/LICENSE_1_0.txt. #ifndef BOOST_CONVERT_IS_FUNCTION_HPP #define BOOST_CONVERT_IS_FUNCTION_HPP #include <boost/convert/detail/config.hpp> #include <boost/convert/detail/has_member.hpp> #include <boost/utility/enable_if.hpp> #include <boost/type_traits.hpp> #include <boost/function_types/is_function_pointer.hpp> #include <boost/function_types/function_arity.hpp> #include <boost/function_types/result_type.hpp> namespace boost { namespace cnv { typedef ::boost::type_traits::yes_type yes_type; typedef ::boost::type_traits:: no_type no_type; template <bool has_operator, typename Functor, typename TypeOut> struct check_functor { BOOST_STATIC_CONSTANT(bool, value = false); }; template<typename Func, typename TypeOut, class Enable =void> struct is_fun { BOOST_STATIC_CONSTANT(bool, value = false); }; template <typename Functor, typename TypeOut> struct check_functor<true, Functor, TypeOut> { static yes_type test (TypeOut const&); static no_type test (...); static const bool value = sizeof(yes_type) == sizeof(test(((Functor*) 0)->operator()())); }; template<typename Functor, typename TypeOut> struct is_fun<Functor, TypeOut, typename enable_if_c<is_class<Functor>::value && !is_convertible<Functor, TypeOut>::value, void>::type> { BOOST_DECLARE_HAS_MEMBER(has_funop, operator()); BOOST_STATIC_CONSTANT(bool, value = (check_functor<has_funop<Functor>::value, Functor, TypeOut>::value)); }; template<typename Function, typename TypeOut> struct is_fun<Function, TypeOut, typename enable_if_c< function_types::is_function_pointer<Function>::value && function_types::function_arity<Function>::value == 0 && !is_same<Function, TypeOut>::value, void>::type> { typedef TypeOut out_type; typedef typename function_types::result_type<Function>::type func_out_type; BOOST_STATIC_CONSTANT(bool, value = (is_convertible<func_out_type, out_type>::value)); }; }} #endif // BOOST_CONVERT_IS_FUNCTION_HPP