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 > Template:mark c++11 feature </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::true_type or std::false_type
Member objects
value |
Template:cpp if T is a trivial type, Template:cpp otherwise (public member object) |
Notes
Only arrays of trivial type may be safely passed to Template:cpp or other functions that accept objects or arrays as arguments of type Template:cpp.
Equivalent definition
Example
See also
(C++11) |
checks if a type is trivially copyable (class template) |