...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
template<class To, template<class...> class Op, class... Args> using is_detected_convertible = is_convertible<detected_t<Op, Args...>, To>; template<class To, template<class...> class Op, class... Args> constexpr bool is_detected_convertible_v = is_detected_convertible<Op, Args...>::value;
C++ Standard Paper: N4502
Compiler Compatibility: Requires C++11 variadic templates and C++11 template aliases.
Header: #include
<boost/type_traits/is_detected_convertible.hpp>
The type is_detected_convertible<To, Op,
Args>
is an alias for true_type
if the result of Op<Args>
is convertible to type To
.
Otherwise it's the type false_type;
Examples:
template<class T> using size_type_t = typename T::size_type; static_assert(boost::is_detected_convertible_v<std::size_t, size_type_t, T>);
See also: is_detected, is_detected_exact.