A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../io/basic_stringbuf/../basic_streambuf/../../meta.html below:

Metaprogramming library (since C++11) - cppreference.com

C++ provides metaprogramming facilities, such as type traits, compile-time rational arithmetic, and compile-time integer sequences.

[edit] Definitions

The following types are collectively called referenceable types:

For any referenceable type T, a reference to it can be created[1].

  1. ↑ For reference types, this can be done via reference collapsing.
[edit] 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.

[edit] Base classes

Most of non-transforming type traits need to be publicly and unambiguously derived from std::integral_constant in order to satisfy the requirements of UnaryTypeTrait or BinaryTypeTrait.

Two specializations of std::integral_constant for the type bool are provided:

[edit] 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.

[edit] 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<std::size_t, Value>, where Value is the query result of the corresponding property.

obtains the type's alignment requirements
(class template) [edit] obtains the number of dimensions of an array type
(class template) [edit] obtains the size of an array type along a specified dimension
(class template) [edit] [edit] 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.

[edit] Type transformations

Type transformation traits transform one type to another following some predefined rules.

All these type traits satisfy TransformationTrait.

[edit] Logical operations (since C++17)

Logical operator traits apply logical operators to other type traits.

[edit] Member relationships (since C++20) [edit] Compile-time rational arithmetic

The header <ratio> provides types and functions for manipulating and storing compile-time ratios.

[edit] Compile-time integer sequences (since C++14)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4