7.9. Type Traits

7.9 Type Traits

The C++ front end implements syntactic extensions that allow compile-time determination of various characteristics of a type (or of a pair of types).

__has_nothrow_assign (type)

If type is const qualified or is a reference type then the trait is false. Otherwise if __has_trivial_assign (type) is true then the trait is true, else if type is a cv class or union type with copy assignment operators that are known not to throw an exception then the trait is true, else it is false. Requires: type shall be a complete type, (possibly cv-qualified) void, or an array of unknown bound.

__has_nothrow_copy (type)

If __has_trivial_copy (type) is true then the trait is true, else if type is a cv class or union type with copy constructors that are known not to th