RAD Studio |  |

__is_trivial
See Also
Collapse All

Category

Type Trait Functions

Syntax

bool __is_trivial( typename T )

Returns true if and only if T is a trivial type.

Error if T is an incomplete type.

Trivial types are defined in Section 3.9 p10 of the Working Draft.

Trivial classes are defined in Section 9 p5 of the Working Draft.

Returns true if T is both const and volatile qualified.

A type is trivial if it is:

- a scalar type
- an array of trivial types
- a class/union type where all 4 special members are trivial:
  - default constructor
  - copy constructor
  - copy assignment operator
  - destructor

Consult this online help for the definition of each __has_trivial_* traits.

Trivial types trigger several special clauses in the standard, which may affect code generation and optimizations, or simply whether certain constructs are undefined.

Note that trivial types are a generalization of PODs (plain old data objects) in the 2003 standard, if the POD/trivial refinement has not happened when this type function is initially implanted.

See Also

C++0x Features (C++Builder 2009)

Type Trait Functions Overview

Working Draft — Standard for Programming Language C++ - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2588.pdf

__has_trivial_assign.xml

__has_trivial_copy_constructor

__has_trivial_copy_constructor.xml

__has_trivial_default_constructor.xml

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!