std::is_convertible
From cppreference.com
Template:cpp/types/sidebar Template:ddcl list begin <tr class="t-dsc-header">
<td>Defined in header
</td>
<type_traits>
<td></td> <td></td> </tr> <tr class="t-dcl ">
<td >template< class From, class To >
struct is_convertible;
</td>
struct is_convertible;
<td class="t-dcl-nopad"> </td> <td > Template:mark c++11 feature </td> </tr> Template:ddcl list end
If an imaginary rvalue of type From
can used in the return statement of a function returning To
, that is, if it can be converted to To
using implicit conversion, provides the member constant value
equal to Template:cpp. Otherwise value
is Template:cpp.
Contents |
Inherited from std::integral_constant
Member constants
value [static] |
true if From is convertible to To , false otherwise (public static member constant) |
Member functions
operator bool |
converts the object to bool, returns value (public member function) |
operator() (C++14) |
returns value (public member function) |
Member types
Type | Definition |
value_type
|
bool |
type
|
std::integral_constant<bool, value> |
Notes
Gives well-defined results for reference types, void types, array types, and function types.