SysTutorials

Linux Manual Pages › Section 3

stdexperimentalrangesconvertibleto(3)

std::experimental::ranges::ConvertibleTo - std::experimental::ranges::ConvertibleTo

Synopsis

Defined in header <experimental/ranges/concepts>
template <class From, class To>
concept bool ConvertibleTo =
std::is_convertible<From, To>::value &&           (ranges TS)
requires(From (&f)()) {
    static_cast<To>(f());
};

The concept ConvertibleTo<From, To> specifies that an expression of the type and value category specified by From can be implicitly and explicitly converted to the type To, and the two forms of conversion are equivalent. Specifically, ConvertibleTo<From, To> is satisfied only if, given the invented function To test(From (&f)()) { return f(); } and a function f of type From () such that the expression f() is equality-preserving (see below),

See also

is_convertible is_nothrow_convertible checks if a type can be converted to the other type                        (class template) (C++11) (C++20)