The Requirements subclauses may describe names that are used to specify constraints on template arguments.160 These names are used in library Clauses to describe the types that may be supplied as arguments by a C++ program when instantiating template components from the library.
Certain types defined in Clause [input.output] are used to describe implementation-defined types. They are based on other types, but with added constraints.
20.4.2.1.2 Exposition-only types [expos.only.types]Several types defined in Clauses [language.support] through [thread] and Annex [depr] that are used as function parameter or return types are defined for the purpose of exposition only in order to capture their language linkage. The declarations of such types are followed by a comment ending in exposition only. [ Example:
namespace std { extern "C" using some-handler = int(int, void*, double); }
The type placeholder some-handler can now be used to specify a function that takes a callback parameter with C language linkage. — end example ]
20.4.2.1.3 Enumerated types [enumerated.types]Several types defined in Clause [input.output] are enumerated types. Each enumerated type may be implemented as an enumeration or as a synonym for an enumeration.161
The enumerated type enumerated can be written:
enum enumerated { \textit{V}0, \textit{V}1, \textit{V}2, \textit{V}3, ..... }; inline const \textit{enumerated C}0(\textit{V}0); inline const \textit{enumerated C}1(\textit{V}1); inline const \textit{enumerated C}2(\textit{V}2); inline const \textit{enumerated C}3(\textit{V}3); .....
Here, the names \textit{C}0, \textit{C}1, etc. represent enumerated elements for this particular enumerated type. All such elements have distinct values.
20.4.2.1.4 Bitmask types [bitmask.types]The bitmask type bitmask can be written:
enum bitmask : int_type { \textit{V}0 = 1 << 0, \textit{V}1 = 1 << 1, \textit{V}2 = 1 << 2, \textit{V}3 = 1 << 3, ..... }; inline constexpr \textit{bitmask C}0(\textit{V}0); inline constexpr \textit{bitmask C}1(\textit{V}1); inline constexpr \textit{bitmask C}2(\textit{V}2); inline constexpr \textit{bitmask C}3(\textit{V}3); ..... constexpr bitmask operator&(bitmask X, bitmask Y) { return static_cast<bitmask>( static_cast<int_type>(X) & static_cast<int_type>(Y)); } constexpr bitmask operator|(bitmask X, bitmask Y) { return static_cast<bitmask>( static_cast<int_type>(X) | static_cast<int_type>(Y)); } constexpr bitmask operator^(bitmask X, bitmask Y){ return static_cast<bitmask>( static_cast<int_type>(X) ^ static_cast<int_type>(Y)); } constexpr bitmask operator~(bitmask X){ return static_cast<bitmask>(~static_cast<int_type>(X)); } bitmask& operator&=(bitmask& X, bitmask Y){ X = X & Y; return X; } bitmask& operator|=(bitmask& X, bitmask Y) { X = X | Y; return X; } bitmask& operator^=(bitmask& X, bitmask Y) { X = X ^ Y; return X; }
Here, the names \textit{C}0, \textit{C}1, etc. represent bitmask elements for this particular bitmask type. All such elements have distinct, nonzero values such that, for any pair \textit{C}i and \textit{C}j where i≠j, Ci & Ci is nonzero and Ci & Cj is zero. Additionally, the value 0 is used to represent an empty bitmask, in which no bitmask elements are set.
The following terms apply to objects and values of bitmask types:
To set a value Y in an object X is to evaluate the expression X |= Y.
To clear a value Y in an object X is to evaluate the expression X &= ~Y.
The value Y is set in the object X if the expression X & Y is nonzero.
The C standard library makes widespread use of characters and character sequences that follow a few uniform conventions:
A letter is any of the 26 lowercase or 26 uppercase letters in the basic execution character set.
The decimal-point character is the (single-byte) character used by functions that convert between a (single-byte) character sequence and a value of one of the floating-point types. It is used in the character sequence to denote the beginning of a fractional part. It is represented in Clauses [language.support] through [thread] and Annex [depr] by a period, '.', which is also its value in the "C" locale, but may change during program execution by a call to setlocale(int, const char*),162 or by a change to a locale object, as described in Clauses [locales] and [input.output].
A character sequence is an array object A that can be declared as T A[N], where T is any of the types char, unsigned char, or signed char ([basic.fundamental]), optionally qualified by any combination of const or volatile. The initial elements of the array have defined contents up to and including an element determined by some predicate. A character sequence can be designated by a pointer value S that points to its first element.
The length of an ntbs is the number of elements that precede the terminating null character. An empty ntbs has a length of zero.
The value of an ntbs is the sequence of values of the elements up to and including the terminating null character.
A static ntbs is an ntbs with static storage duration.164
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