Namespaces
Variants
Views
Actions

std::is_trivial

From cppreference.com
< cpp‎ | types
Revision as of 14:55, 24 December 2011 by P12bot (Talk | contribs)

Template:cpp/types/sidebar Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <type_traits>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td >
template< class T >
struct is_trivial;
</td>

<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

Template:eq fun cpp

Example

Template:example cpp

See also

checks if a type is trivially copyable
(class template) [edit]