std::is_trivial
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 T >
struct is_trivial;
</td>
struct is_trivial;
<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> Template:ddcl list end
If T
is a trivial type (that is, a scalar type, a trivially copyable class with a trivial default constructor, or array of such type/class, possibly cv-qualified), provides the member constant value
equal Template:cpp. For any other type, value
is Template:cpp.
Contents |
Inherited from std::integral_constant
Member constants
value [static] |
true if T is a trivial type , 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
Only objects (including arrays) of trivial type may be created by a call to Template:cpp.
Equivalent definition
Example
See also
(C++11) |
checks if a type is trivially copyable (class template) |