// Copyright (c) 2009-2020 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_CONVERTER_HPP #define BOOST_CONVERT_IS_CONVERTER_HPP #include #include #include #include namespace boost { namespace cnv { template struct is_cnv { BOOST_STATIC_CONSTANT(bool, value = false); }; template struct is_cnv::value, void>::type> { typedef typename ::boost::unwrap_reference::type class_type; typedef void signature_type(TypeIn const&, optional&); BOOST_DECLARE_IS_CALLABLE(is_callable, operator()); BOOST_STATIC_CONSTANT(bool, value = (is_callable::value)); }; template struct is_cnv::value && function_types::function_arity::value == 2, void>::type> { using in_type = TypeIn; using out_type = optional&; using func_in_type = typename function_traits::arg1_type; using func_out_type = typename function_traits::arg2_type; BOOST_STATIC_CONSTANT(bool, in_good = (is_convertible::value)); BOOST_STATIC_CONSTANT(bool, out_good = (is_same::value)); BOOST_STATIC_CONSTANT(bool, value = (in_good && out_good)); }; }} #endif // BOOST_CONVERT_IS_CONVERTER_HPP