SysTutorials

Linux Manual Pages › Section 3

stdconvertibleto(3)

std::ConvertibleTo - std::ConvertibleTo

Synopsis

Defined in header <concepts>
template <class From, class To>
concept ConvertibleTo =
std::is_convertible_v<From, To> &&  (since C++20)
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 a function fun of type From () such that the expression fun() 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)