A RetroSearch Logo

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

Search Query:

Showing content from https://timsong-cpp.github.io/cppwp/n4659/meta.unary.prop.query below:

[meta.unary.prop.query]

23 General utilities library [utilities] 23.15 Metaprogramming and type traits [meta] 23.15.5 Type property queries [meta.unary.prop.query]

This subclause contains templates that may be used to query properties of types at compile time.

Table

43

— Type property queries


Template Value template <class T>
struct alignment_­of;
alignof(T).
Requires: alignof(T) shall be a valid expression ([expr.alignof]) template <class T>
struct rank;
If T names an array type, an integer value representing the number of dimensions of T; otherwise, 0. template <class T,
unsigned I = 0>
struct extent;
If T is not an array type, or if it has rank less than or equal to I, or if I is 0 and T has type “array of unknown bound of U”, then 0; otherwise, the bound ([dcl.array]) of the I'th dimension of T, where indexing of I is zero-based

Each of these templates shall be a UnaryTypeTrait with a base characteristic of integral_­constant<size_­t, Value>.

[Example:

assert(rank_v<int> == 0);
assert(rank_v<int[2]> == 1);
assert(rank_v<int[][4]> == 2);

end example]

[Example:

assert(extent_v<int> == 0);
assert(extent_v<int[2]> == 2);
assert(extent_v<int[2][4]> == 2);
assert(extent_v<int[][4]> == 0);
assert((extent_v<int, 1>) == 0);
assert((extent_v<int[2], 1>) == 0);
assert((extent_v<int[2][4], 1>) == 4);
assert((extent_v<int[][4], 1>) == 4);

end example]


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