RAD Studio |  |

__has_trivial_assign
See Also
Collapse All

Category

Type Trait Functions

Syntax

bool __has_trivial_assign (typename T )

Returns true if and only if T has a trivial copy assignment operator.

Error if T is an incomplete type.

The definition from Section 20.4.4.3 of the Working Draft notes says a type T has a trivial copy assignment operator if T is neither const nor a reference type and T is one of:

- a scalar type (or array thereof)
- a class type with a trivial copy assignment operator

According to Section 21.8 p11 of the Working Draft, a copy assignment operator for class X is trivial if:

- It is not user provided
- class X has no virtual functions
- class X has no virtual base classes
- each direct base class of X has a trivial copy assignment operator.
- for all the non-static data members of X that are of class type (or array thereof), each such class type has a trivial copy assignment operator;

A copy assignment operator is not user provided if it is implicitly declared, or defined inline as = default;.

Ox interaction false if the copy assign operator is defined as deleted.

Ox interaction false if the copy assign operator is defined as deleted.

Ox interaction false if the default constructor is defined as deleted.

Ox interaction with default function definitions.

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

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