|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||
Defined in header <concepts> | ||
template<class From,class To> concept convertible_to= | (since C++20) | |
The conceptconvertible_to<From, To> specifies that an expression of the same type and value category as those ofstd::declval<From>() can be implicitly and explicitly converted to the typeTo, and the two forms of conversion produce equal results.
Contents |
convertible_to<From, To> is modeled only if, given a functionfun of typestd::add_rvalue_reference_t<From>() such that the expressionfun() isequality-preserving,
To is neither an object type nor a reference-to-object type, orExpressions declared inrequires expressions of the standard library concepts are required to beequality-preserving (except where stated otherwise).
convertible_to [concept.convertible] convertible_to [concept.convertible] (C++11)(C++20) | checks if a type can be converted to the other type (class template)[edit] |