Difference between revisions of "cpp/meta"
m (added c++23's std::is_implicit_lifetime) |
(Reorganized the type trait list.) |
||
Line 4: | Line 4: | ||
C++ provides metaprogramming facilities, such as type traits, compile-time rational arithmetic, and compile-time integer sequences. | C++ provides metaprogramming facilities, such as type traits, compile-time rational arithmetic, and compile-time integer sequences. | ||
− | + | ===Type traits=== | |
− | ===Type | + | Type traits define compile-time template-based interfaces to query the properties of types. |
− | + | ||
− | Attempting to specialize a template defined in the {{header|type_traits}} header and | + | Attempting to specialize a template defined in the {{header|type_traits}} header and listed in this page results in undefined behavior, except that {{lc|std::common_type}} {{rev inl|since=c++20|and {{ltt|cpp/types/common_reference|std::basic_common_reference}}}} may be specialized as required in description. |
A template defined in the {{header|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. | A template defined in the {{header|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. | ||
− | + | ====Base classes==== | |
− | + | Most of non-transforming type traits need to be publicly and unambiguously derived from {{lc|std::integeral_constant}} in order to satisfy the requirements of {{named req|UnaryTypeTrait}} or {{named req|BinaryTypeTrait}}. | |
− | + | ||
− | {{ | + | |
− | {{ | + | |
− | {{ | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc | + | {{dsc header|type_traits}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc inc|cpp/types/dsc integral_constant}} |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
{{dsc end}} | {{dsc end}} | ||
+ | Two specializations of {{lc|std::integral_constant}} for the type {{c/core|bool}} are provided: | ||
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc | + | {{dsc header|type_traits}} |
− | {{dsc | + | {{dsc hitem|Type|Definition}} |
− | {{dsc | + | {{dsc|{{tt|true_type}}|{{c/core|std::integral_constant<bool, true>}}}} |
− | {{dsc | + | {{dsc|{{tt|false_type}}|{{c/core|std::integral_constant<bool, false>}}}} |
{{dsc end}} | {{dsc end}} | ||
+ | |||
+ | ====Unary type traits==== | ||
+ | Unary type traits can be used to query the boolean properties of a type at compile time. | ||
+ | |||
+ | All these type traits satisfy {{named req|UnaryTypeTrait}}, the base characteristic of each type trait is either {{lc|std::true_type}} or {{lc|std::false_type}}, depending on whether the corresponding condition is met. | ||
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc h2 | Type | + | {{dsc h2|Primary type categories}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc header|type_traits}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc inc|cpp/types/dsc is_void}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc inc|cpp/types/dsc is_null_pointer}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc inc|cpp/types/dsc is_integral}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc inc|cpp/types/dsc is_floating_point}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc inc|cpp/types/dsc is_array}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc inc|cpp/types/dsc is_enum}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc inc|cpp/types/dsc is_union}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc inc|cpp/types/dsc is_class}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc inc|cpp/types/dsc is_function}} |
+ | {{dsc inc|cpp/types/dsc is_pointer}} | ||
+ | {{dsc inc|cpp/types/dsc is_lvalue_reference}} | ||
+ | {{dsc inc|cpp/types/dsc is_rvalue_reference}} | ||
+ | {{dsc inc|cpp/types/dsc is_member_object_pointer}} | ||
+ | {{dsc inc|cpp/types/dsc is_member_function_pointer}} | ||
+ | |||
+ | {{dsc h2|Composite type categories}} | ||
+ | {{dsc header|type_traits}} | ||
+ | {{dsc inc|cpp/types/dsc is_fundamental}} | ||
+ | {{dsc inc|cpp/types/dsc is_arithmetic}} | ||
+ | {{dsc inc|cpp/types/dsc is_scalar}} | ||
+ | {{dsc inc|cpp/types/dsc is_object}} | ||
+ | {{dsc inc|cpp/types/dsc is_compound}} | ||
+ | {{dsc inc|cpp/types/dsc is_reference}} | ||
+ | {{dsc inc|cpp/types/dsc is_member_pointer}} | ||
+ | |||
+ | {{dsc h2|Type properties}} | ||
+ | {{dsc header|type_traits}} | ||
+ | {{dsc inc|cpp/types/dsc is_const}} | ||
+ | {{dsc inc|cpp/types/dsc is_volatile}} | ||
+ | {{dsc inc|cpp/types/dsc is_trivial}} | ||
+ | {{dsc inc|cpp/types/dsc is_trivially_copyable}} | ||
+ | {{dsc inc|cpp/types/dsc is_standard_layout}} | ||
+ | {{dsc inc|cpp/types/dsc is_pod}} | ||
+ | {{dsc inc|cpp/types/dsc is_literal_type}} | ||
+ | {{dsc inc|cpp/types/dsc has_unique_object_representations}} | ||
+ | {{dsc inc|cpp/types/dsc is_empty}} | ||
+ | {{dsc inc|cpp/types/dsc is_polymorphic}} | ||
+ | {{dsc inc|cpp/types/dsc is_abstract}} | ||
+ | {{dsc inc|cpp/types/dsc is_final}} | ||
+ | {{dsc inc|cpp/types/dsc is_aggregate}} | ||
+ | {{dsc inc|cpp/types/dsc is_implicit_lifetime}} | ||
+ | {{dsc inc|cpp/types/dsc is_signed}} | ||
+ | {{dsc inc|cpp/types/dsc is_unsigned}} | ||
+ | {{dsc inc|cpp/types/dsc is_bounded_array}} | ||
+ | {{dsc inc|cpp/types/dsc is_unbounded_array}} | ||
+ | {{dsc inc|cpp/types/dsc is_scoped_enum}} | ||
{{dsc end}} | {{dsc end}} | ||
− | |||
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc header | type_traits}} | + | {{dsc h2|Supported operations}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc header|type_traits}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc inc|cpp/types/dsc is_constructible}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc inc|cpp/types/dsc is_default_constructible}} |
+ | {{dsc inc|cpp/types/dsc is_copy_constructible}} | ||
+ | {{dsc inc|cpp/types/dsc is_move_constructible}} | ||
+ | {{dsc inc|cpp/types/dsc is_assignable}} | ||
+ | {{dsc inc|cpp/types/dsc is_copy_assignable}} | ||
+ | {{dsc inc|cpp/types/dsc is_move_assignable}} | ||
+ | {{dsc inc|cpp/types/dsc is_destructible}} | ||
+ | {{dsc inc|cpp/types/dsc has_virtual_destructor}} | ||
+ | {{dsc inc|cpp/types/dsc is_swappable}} | ||
+ | {{dsc inc|cpp/types/dsc reference_constructs_from_temporary}} | ||
+ | {{dsc inc|cpp/types/dsc reference_converts_from_temporary}} | ||
{{dsc end}} | {{dsc end}} | ||
− | ==== | + | ====Property queries==== |
+ | Property query traits can be used to query the integral properties of a type at compile time. | ||
+ | |||
+ | All these type traits satisfy {{named req|UnaryTypeTrait}}, the base characteristic of each type trait is {{c/core|std::integral_constant<size_t, Value>}}, where {{c|Value}} is the query result of the corresponding property. | ||
+ | |||
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc header | type_traits}} | + | {{dsc header|type_traits}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc inc|cpp/types/dsc alignment_of}} |
+ | {{dsc inc|cpp/types/dsc rank}} | ||
+ | {{dsc inc|cpp/types/dsc extent}} | ||
{{dsc end}} | {{dsc end}} | ||
− | + | ====Type relationships==== | |
+ | Type relationship traits can be used to query relationships between types at compile time. | ||
+ | |||
+ | All these type traits satisfy {{named req|BinaryTypeTrait}}, the base characteristic of each type trait is either {{lc|std::true_type}} or {{lc|std::false_type}}, depending on whether the corresponding condition is met. | ||
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc header | type_traits}} | + | {{dsc header|type_traits}} |
− | {{dsc | + | {{dsc inc|cpp/types/dsc is_same}} |
− | {{dsc | + | {{dsc inc|cpp/types/dsc is_base_of}} |
− | {{dsc | | + | {{dsc inc|cpp/types/dsc is_convertible}} |
− | {{dsc | | + | {{dsc inc|cpp/types/dsc is_layout_compatible}} |
+ | {{dsc inc|cpp/types/dsc is_pointer_interconvertible_base_of}} | ||
+ | {{dsc inc|cpp/types/dsc is_invocable}} | ||
{{dsc end}} | {{dsc end}} | ||
− | ===Type | + | ====Type transformations==== |
− | + | Type transformation traits transform one type to another following some predefined rules. | |
− | + | All these type traits satisfy {{named req|TransformationTrait}}. | |
− | + | ||
− | + | ||
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc | + | {{dsc h2|Const-volatility specifiers}} |
− | {{dsc | + | {{dsc header|type_traits}} |
− | {{dsc inc | cpp/types/dsc remove_cv}} | + | {{dsc inc|cpp/types/dsc remove_cv}} |
− | {{dsc inc | cpp/types/dsc add_cv}} | + | {{dsc inc|cpp/types/dsc add_cv}} |
− | {{dsc h2 | References}} | + | {{dsc h2|References}} |
− | {{dsc inc | cpp/types/dsc remove_reference}} | + | {{dsc header|type_traits}} |
− | {{dsc inc | cpp/types/dsc add_reference}} | + | {{dsc inc|cpp/types/dsc remove_reference}} |
+ | {{dsc inc|cpp/types/dsc add_reference}} | ||
− | {{dsc h2 | | + | {{dsc h2|Sign modifiers}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc header|type_traits}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc inc|cpp/types/dsc make_signed}} |
+ | {{dsc inc|cpp/types/dsc make_unsigned}} | ||
− | {{dsc h2 | | + | {{dsc h2|Arrays}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc header|type_traits}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc inc|cpp/types/dsc remove_extent}} |
+ | {{dsc inc|cpp/types/dsc remove_all_extents}} | ||
− | {{dsc h2 | | + | {{dsc h2|Pointers}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc header|type_traits}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc inc|cpp/types/dsc remove_pointer}} |
+ | {{dsc inc|cpp/types/dsc add_pointer}} | ||
+ | |||
+ | {{dsc h2|Other transformations}} | ||
+ | {{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}} | ||
+ | |||
+ | ====Logical operations==== | ||
+ | Logical operator traits apply logical operators to other type traits. | ||
+ | {{dsc begin}} | ||
+ | {{dsc header|type_traits}} | ||
+ | {{dsc inc|cpp/types/dsc conjunction}} | ||
+ | {{dsc inc|cpp/types/dsc disjunction}} | ||
+ | {{dsc inc|cpp/types/dsc negation}} | ||
{{dsc end}} | {{dsc end}} | ||
− | ==== | + | ====Member relationships==== |
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc header | type_traits}} | + | {{dsc header|type_traits}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc inc|cpp/types/dsc is_pointer_interconvertible_with_class}} |
− | {{dsc inc | cpp/types/dsc | + | {{dsc inc|cpp/types/dsc is_corresponding_member}} |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
{{dsc end}} | {{dsc end}} | ||
− | ===[[cpp/numeric/ratio|Compile-time rational arithmetic]] | + | ===[[cpp/numeric/ratio|Compile-time rational arithmetic]]=== |
The header {{header|ratio}} provides [[cpp/numeric/ratio|types and functions for manipulating and storing compile-time ratios]]. | The header {{header|ratio}} provides [[cpp/numeric/ratio|types and functions for manipulating and storing compile-time ratios]]. | ||
− | ===Compile-time integer sequences | + | ===Compile-time integer sequences=== |
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc header | utility}} | + | {{dsc header|utility}} |
− | {{dsc inc | cpp/utility/dsc integer_sequence}} | + | {{dsc inc|cpp/utility/dsc integer_sequence}} |
{{dsc end}} | {{dsc end}} | ||
{{langlinks|de|es|fr|it|ja|pt|ru|zh}} | {{langlinks|de|es|fr|it|ja|pt|ru|zh}} |
Revision as of 01:35, 8 August 2023
C++ provides metaprogramming facilities, such as type traits, compile-time rational arithmetic, and compile-time integer sequences.
Contents |
Type traits
Type traits define compile-time template-based interfaces to query the properties of types.
Attempting to specialize a template defined in the <type_traits> header and listed in this page results in undefined behavior, except that std::common_type and std::basic_common_reference(since C++20) may be specialized as required in description.
A template defined in the <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.
Base classes
Most of non-transforming type traits need to be publicly and unambiguously derived from std::integeral_constant in order to satisfy the requirements of UnaryTypeTrait or BinaryTypeTrait.
Defined in header
<type_traits> | |
(C++11)(C++17) |
compile-time constant of specified type with specified value (class template) |
Two specializations of std::integral_constant for the type bool are provided:
Defined in header
<type_traits> | |
Type | Definition |
true_type
|
std::integral_constant<bool, true> |
false_type
|
std::integral_constant<bool, false> |
Unary type traits
Unary type traits can be used to query the boolean properties of a type at compile time.
All these type traits satisfy UnaryTypeTrait, the base characteristic of each type trait is either std::true_type or std::false_type, depending on whether the corresponding condition is met.
Primary type categories | |
Defined in header
<type_traits> | |
(C++11) |
checks if a type is void (class template) |
(C++14) |
checks if a type is std::nullptr_t (class template) |
(C++11) |
checks if a type is an integral type (class template) |
(C++11) |
checks if a type is a floating-point type (class template) |
(C++11) |
checks if a type is an array type (class template) |
(C++11) |
checks if a type is an enumeration type (class template) |
(C++11) |
checks if a type is a union type (class template) |
(C++11) |
checks if a type is a non-union class type (class template) |
(C++11) |
checks if a type is a function type (class template) |
(C++11) |
checks if a type is a pointer type (class template) |
(C++11) |
checks if a type is an lvalue reference (class template) |
(C++11) |
checks if a type is an rvalue reference (class template) |
(C++11) |
checks if a type is a non-static member object pointer (class template) |
(C++11) |
checks if a type is a non-static member function pointer (class template) |
Composite type categories | |
Defined in header
<type_traits> | |
(C++11) |
checks if a type is a fundamental type (class template) |
(C++11) |
checks if a type is an arithmetic type (class template) |
(C++11) |
checks if a type is a scalar type (class template) |
(C++11) |
checks if a type is an object type (class template) |
(C++11) |
checks if a type is a compound type (class template) |
(C++11) |
checks if a type is either an lvalue reference or rvalue reference (class template) |
(C++11) |
checks if a type is a pointer to a non-static member function or object (class template) |
Type properties | |
Defined in header
<type_traits> | |
(C++11) |
checks if a type is const-qualified (class template) |
(C++11) |
checks if a type is volatile-qualified (class template) |
(C++11) |
checks if a type is trivial (class template) |
(C++11) |
checks if a type is trivially copyable (class template) |
(C++11) |
checks if a type is a standard-layout type (class template) |
(C++11)(deprecated in C++20) |
checks if a type is a plain-old data (POD) type (class template) |
(C++11)(deprecated in C++17)(removed in C++20) |
checks if a type is a literal type (class template) |
checks if every bit in the type's object representation contributes to its value (class template) | |
(C++11) |
checks if a type is a class (but not union) type and has no non-static data members (class template) |
(C++11) |
checks if a type is a polymorphic class type (class template) |
(C++11) |
checks if a type is an abstract class type (class template) |
(C++14) |
checks if a type is a final class type (class template) |
(C++17) |
checks if a type is an aggregate type (class template) |
(C++23) |
checks if a type is an implicit-lifetime type (class template) |
(C++11) |
checks if a type is a signed arithmetic type (class template) |
(C++11) |
checks if a type is an unsigned arithmetic type (class template) |
(C++20) |
checks if a type is an array type of known bound (class template) |
(C++20) |
checks if a type is an array type of unknown bound (class template) |
(C++23) |
checks if a type is a scoped enumeration type (class template) |
Supported operations | |
Defined in header
<type_traits> | |
(C++11)(C++11)(C++11) |
checks if a type has a constructor for specific arguments (class template) |
checks if a type has a default constructor (class template) | |
(C++11)(C++11)(C++11) |
checks if a type has a copy constructor (class template) |
(C++11)(C++11)(C++11) |
checks if a type can be constructed from an rvalue reference (class template) |
(C++11)(C++11)(C++11) |
checks if a type has an assignment operator for a specific argument (class template) |
(C++11)(C++11)(C++11) |
checks if a type has a copy assignment operator (class template) |
(C++11)(C++11)(C++11) |
checks if a type has a move assignment operator (class template) |
(C++11)(C++11)(C++11) |
checks if a type has a non-deleted destructor (class template) |
(C++11) |
checks if a type has a virtual destructor (class template) |
(C++17)(C++17)(C++17)(C++17) |
checks if objects of a type can be swapped with objects of same or different type (class template) |
checks if a reference is bound to a temporary in direct-initialization (class template) | |
checks if a reference is bound to a temporary in copy-initialization (class template) |
Property queries
Property query traits can be used to query the integral properties of a type at compile time.
All these type traits satisfy UnaryTypeTrait, the base characteristic of each type trait is std::integral_constant<size_t, Value>, where Value is the query result of the corresponding property.
Defined in header
<type_traits> | |
(C++11) |
obtains the type's alignment requirements (class template) |
(C++11) |
obtains the number of dimensions of an array type (class template) |
(C++11) |
obtains the size of an array type along a specified dimension (class template) |
Type relationships
Type relationship traits can be used to query relationships between types at compile time.
All these type traits satisfy BinaryTypeTrait, the base characteristic of each type trait is either std::true_type or std::false_type, depending on whether the corresponding condition is met.
Defined in header
<type_traits> | |
(C++11) |
checks if two types are the same (class template) |
(C++11) |
checks if a type is a base of the other type (class template) |
(C++11)(C++20) |
checks if a type can be converted to the other type (class template) |
(C++20) |
checks if two types are layout-compatible (class template) |
checks if a type is a pointer-interconvertible (initial) base of another type (class template) | |
checks if a type can be invoked (as if by std::invoke) with the given argument types (class template) |
Type transformations
Type transformation traits transform one type to another following some predefined rules.
All these type traits satisfy TransformationTrait.
Const-volatility specifiers | |
Defined in header
<type_traits> | |
(C++11)(C++11)(C++11) |
removes const and/or volatile specifiers from the given type (class template) |
(C++11)(C++11)(C++11) |
adds const and/or volatile specifiers to the given type (class template) |
References | |
Defined in header
<type_traits> | |
(C++11) |
removes a reference from the given type (class template) |
(C++11)(C++11) |
adds an lvalue or rvalue reference to the given type (class template) |
Sign modifiers | |
Defined in header
<type_traits> | |
(C++11) |
obtains the corresponding signed type for the given integral type (class template) |
(C++11) |
obtains the corresponding signed type for the given integral type (class template) |
Arrays | |
Defined in header
<type_traits> | |
(C++11) |
removes one extent from the given array type (class template) |
(C++11) |
removes all extents from the given array type (class template) |
Pointers | |
Defined in header
<type_traits> | |
(C++11) |
removes a pointer from the given type (class template) |
(C++11) |
adds a pointer to the given type (class template) |
Other transformations | |
Defined in header
<type_traits> | |
(C++11)(deprecated in C++23) |
defines the type suitable for use as uninitialized storage for types of given size (class template) |
(C++11)(deprecated in C++23) |
defines the type suitable for use as uninitialized storage for all given types (class template) |
(C++11) |
applies type transformations as when passing a function argument by value (class template) |
(C++20) |
combines std::remove_cv and std::remove_reference (class template) |
(C++11) |
conditionally removes a function overload or template specialization from overload resolution (class template) |
(C++11) |
chooses one type or another based on compile-time boolean (class template) |
(C++11) |
determines the common type of a group of types (class template) |
determines the common reference type of a group of types (class template) | |
(C++11) |
obtains the underlying integer type for a given enumeration type (class template) |
(C++11)(removed in C++20)(C++17) |
deduces the result type of invoking a callable object with a set of arguments (class template) |
(C++17) |
void variadic alias template (alias template) |
(C++20) |
returns the type argument unchanged (class template) |
Logical operations
Logical operator traits apply logical operators to other type traits.
Defined in header
<type_traits> | |
(C++17) |
variadic logical AND metafunction (class template) |
(C++17) |
variadic logical OR metafunction (class template) |
(C++17) |
logical NOT metafunction (class template) |
Member relationships
Defined in header
<type_traits> | |
checks if objects of a type are pointer-interconvertible with the specified subobject of that type (function template) | |
(C++20) |
checks if two specified members correspond to each other in the common initial subsequence of two specified types (function template) |
Compile-time rational arithmetic
The header <ratio> provides types and functions for manipulating and storing compile-time ratios.
Compile-time integer sequences
Defined in header
<utility> | |
(C++14) |
implements compile-time sequence of integers (class template) |