// Copyright (c) 2009-2014 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 #include namespace boost { namespace cnv { template struct is_cnv { BOOST_STATIC_CONSTANT(bool, value = false); }; template struct is_cnv, 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> { typedef TypeIn in_type; typedef optional& out_type; typedef typename function_traits::arg1_type func_in_type; typedef typename function_traits::arg2_type func_out_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