c_plus_plus_types

C++ Type support (basic types, RTTI, type traits)

Additional basic types and macros

}}

}}

[[cpp/types/integer ]] | [[ Fixed width integer types]] {{mark since c++11}}

Numeric limits

[[cpp/types/climits]] | [[C numeric limits interface]]

Runtime type identification

Type property

These type traits define compile-time template-based interfaces to query the properties of types.

Attempting to specialize a template defined in the

header and described in this section results in undefined behavior.

A template defined in the

header may be instantiated with an incomplete type unless otherwise specified, notwithstanding the general prohibition against instantiating standard library templates with incomplete types.

Operations on traits

Base classes

Two specializations of

for the type

are provided:

]] | {{c | integral_constant<bool, true>}}}} {{dsc | {{tt | false_type}} | {{c | integral_constant<bool, false>}}}} {{dsc end}} ===Type modifications=== These type traits apply modifications on a template parameter, and declare (sometimes conditionally) the {{tt | type}} member typedef as the resulting type. Attempting to specialize a template defined in the {{tt | <type_traits>}} header and described in this section results in undefined behavior, except that {{lc | common_type}} {{rev inl | since=c++20 | and {{ltt | cpp/types/common_reference | basic_common_reference}}}} may be specialized as required in description. A template defined in the {{tt | <type_traits>}} header may be instantiated with an incomplete type unless otherwise specified, notwithstanding the general prohibition against instantiating standard library templates with incomplete types. {{dsc begin}} {{dsc header | type_traits}} {{dsc h2 | Const-volatility specifiers}} {{dsc inc | cpp/types/dsc remove_cv}} {{dsc inc | cpp/types/dsc add_cv}} {{dsc h2 | References}} {{dsc inc | cpp/types/dsc remove_reference}} {{dsc inc | cpp/types/dsc add_reference}} {{dsc h2 | Pointers}} {{dsc inc | cpp/types/dsc remove_pointer}} {{dsc inc | cpp/types/dsc add_pointer}} {{dsc h2 | Sign modifiers}} {{dsc inc | cpp/types/dsc make_signed}} {{dsc inc | cpp/types/dsc make_unsigned}} {{dsc h2 | Arrays}} {{dsc inc | cpp/types/dsc remove_extent}} {{dsc inc | cpp/types/dsc remove_all_extents}} {{dsc end}} ====Miscellaneous transformations==== {{dsc begin}} {{dsc header | type_traits}} {{dsc inc | cpp/types/dsc aligned_storage}} {{dsc inc | cpp/types/dsc aligned_union}} {{dsc inc | cpp/types/dsc decay}} {{dsc inc | cpp/types/dsc remove_cvref}} {{dsc inc | cpp/types/dsc enable_if}} {{dsc inc | cpp/types/dsc conditional}} {{dsc inc | cpp/types/dsc common_type}} {{dsc inc | cpp/types/dsc common_reference}} {{dsc inc | cpp/types/dsc underlying_type}} {{dsc inc | cpp/types/dsc result_of}} {{dsc inc | cpp/types/dsc void_t}} {{dsc inc | cpp/types/dsc type_identity}} {{dsc end}} ===See also=== {{dsc begin}} {{dsc see c | c/types | Type support library | nomono=true}} {{dsc end}} {{langlinks | de | es | fr | it | ja | pt | ru | [[zh}}

c_plus_plus_types.txt · Last modified: 2025/02/01 07:13 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki