[type.descriptions]

# 16 Library introduction [[library]](./#library)

## 16.3 Method of description [[description]](description#type.descriptions)

### 16.3.3 Other conventions [[conventions]](conventions#type.descriptions)

#### 16.3.3.3 Type descriptions [type.descriptions]

#### [16.3.3.3.1](#general) General [[type.descriptions.general]](type.descriptions.general)

[1](#general-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L579)

The Requirements subclauses may describe names that are used to specify
constraints on template arguments[.](#general-1.sentence-1)[137](#footnote-137 "Examples from [utility.requirements] include: Cpp17EqualityComparable, Cpp17LessThanComparable, Cpp17CopyConstructible. Examples from [iterator.requirements] include: Cpp17InputIterator, Cpp17ForwardIterator.")

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[.](#general-1.sentence-2)

[2](#general-2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L597)

Certain types defined in [[input.output]](input.output "31 Input/output library") are used to describe implementation-defined types[.](#general-2.sentence-1)

They are based on other types, but with added constraints[.](#general-2.sentence-2)

[137)](#footnote-137)[137)](#footnoteref-137)

Examples
from [[utility.requirements]](utility.requirements "16.4.4 Requirements on types and expressions") include:*Cpp17EqualityComparable*,*Cpp17LessThanComparable*,*Cpp17CopyConstructible*[.](#footnote-137.sentence-1)

Examples from [[iterator.requirements]](iterator.requirements "24.3 Iterator requirements") include:*Cpp17InputIterator*,*Cpp17ForwardIterator*[.](#footnote-137.sentence-2)

#### [16.3.3.3.2](#enumerated.types) Enumerated types [[enumerated.types]](enumerated.types)

[1](#enumerated.types-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L604)

Several types defined in [[input.output]](input.output "31 Input/output library") are[*enumerated types*](#def:type,enumerated "16.3.3.3.2 Enumerated types [enumerated.types]")[.](#enumerated.types-1.sentence-1)

Each enumerated type may be implemented as an enumeration or as a synonym for
an enumeration[.](#enumerated.types-1.sentence-2)[138](#footnote-138 "Such as an integer type, with constant integer values ([basic.fundamental]).")

[2](#enumerated.types-2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L614)

The enumerated type *enumerated* can be written:enum *enumerated* { V0, V1, V2, V3, … };

inline const enumerated C0(V0);inline const enumerated C1(V1);inline const enumerated C2(V2);inline const enumerated C3(V3);
 ⋮

[3](#enumerated.types-3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L626)

Here, the names C0,C1, etc. represent[*enumerated elements*](#def:enumerated_element "16.3.3.3.2 Enumerated types [enumerated.types]") for this particular enumerated type[.](#enumerated.types-3.sentence-1)

All such elements have distinct values[.](#enumerated.types-3.sentence-2)

[138)](#footnote-138)[138)](#footnoteref-138)

Such as an integer type, with constant integer
values ([[basic.fundamental]](basic.fundamental "6.9.2 Fundamental types"))[.](#footnote-138.sentence-1)

#### [16.3.3.3.3](#bitmask.types) Bitmask types [[bitmask.types]](bitmask.types)

[1](#bitmask.types-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L636)

Several types defined in [[support]](support "17 Language support library") through [[exec]](exec "33 Execution control library") and [[depr]](depr "Annex D (normative) Compatibility features") are[*bitmask types*](#def:type,bitmask "16.3.3.3.3 Bitmask types [bitmask.types]")[.](#bitmask.types-1.sentence-1)

Each bitmask type can be implemented as an
enumerated type that overloads certain operators, as an integer type,
or as a[bitset](template.bitset "22.9.2 Class template bitset [template.bitset]")[.](#bitmask.types-1.sentence-2)

[2](#bitmask.types-2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L646)

The bitmask type *bitmask* can be written:// For exposition only.// int_type is an integral type capable of representing all values of the bitmask type.enum *bitmask* : int_type {V0 = 1 << 0, V1 = 1 << 1, V2 = 1 << 2, V3 = 1 << 3, …};

inline constexpr bitmask C0(V0);inline constexpr bitmask C1(V1);inline constexpr bitmask C2(V2);inline constexpr bitmask C3(V3);
 ⋮

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;}

[3](#bitmask.types-3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L687)

Here, the names C0,C1, etc. represent[*bitmask elements*](#def:bitmask,element "16.3.3.3.3 Bitmask types [bitmask.types]") for this particular bitmask type[.](#bitmask.types-3.sentence-1)

All such elements have distinct, nonzero values such that, for any pair Ci and Cj where i â j, Ci & Ci is nonzero andCi & Cj is zero[.](#bitmask.types-3.sentence-2)

Additionally, the value 0 is used to represent an [*empty bitmask*](#def:bitmask,empty "16.3.3.3.3 Bitmask types [bitmask.types]"), in which no
bitmask elements are set[.](#bitmask.types-3.sentence-3)

[4](#bitmask.types-4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L699)

The following terms apply to objects and values of
bitmask types:

- [(4.1)](#bitmask.types-4.1)

  To [*set*](#def:bitmask,value,set "16.3.3.3.3 Bitmask types [bitmask.types]") a value *Y* in an object *X* is to evaluate the expression *X* |= *Y*[.](#bitmask.types-4.1.sentence-1)

- [(4.2)](#bitmask.types-4.2)

  To [*clear*](#def:bitmask,value,clear "16.3.3.3.3 Bitmask types [bitmask.types]") a value *Y* in an object*X* is to evaluate the expression *X* &= ~*Y*[.](#bitmask.types-4.2.sentence-1)

- [(4.3)](#bitmask.types-4.3)

  The value *Y* [*is set*](#def:bitmask,value,is_set "16.3.3.3.3 Bitmask types [bitmask.types]") in the object*X* if the expression *X* & *Y* is nonzero[.](#bitmask.types-4.3.sentence-1)

#### [16.3.3.3.4](#character.seq) Character sequences [[character.seq]](character.seq)

#### [16.3.3.3.4.1](#character.seq.general) General [[character.seq.general]](character.seq.general)

[1](#character.seq.general-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L720)

The C standard library makes widespread useof characters and character sequences that follow a few uniform conventions:

- [(1.1)](#character.seq.general-1.1)

  Properties specified as [*locale-specific*](#def:locale-specific "16.3.3.3.4.1 General [character.seq.general]") may change during program execution
by a call to setlocale(int, const char*) ([[clocale.syn]](clocale.syn "28.3.5.1 Header <clocale> synopsis")), or
by a change to a locale object,
as described in [[locales]](locales "28.3.3 Locales") and [[input.output]](input.output "31 Input/output library")[.](#character.seq.general-1.1.sentence-1)

- [(1.2)](#character.seq.general-1.2)

  The [*execution character set*](#def:character_set,execution "16.3.3.3.4.1 General [character.seq.general]") and
the [*execution wide-character set*](#def:wide-character_set,execution "16.3.3.3.4.1 General [character.seq.general]") are supersets of the basic literal character set ([[lex.charset]](lex.charset "5.3.1 Character sets"))[.](#character.seq.general-1.2.sentence-1)
  The encodings of the execution character sets and
the sets of additional elements (if any) are locale-specific[.](#character.seq.general-1.2.sentence-2)
  Each element of the execution wide-character set is encoded as
a single code unit representable by a value of type wchar_t[.](#character.seq.general-1.2.sentence-3)
  [*Note [1](#character.seq.general-note-1)*:
  The encodings of the execution character sets can be unrelated
to any literal encoding[.](#character.seq.general-1.2.sentence-4)
 â *end note*]

- [(1.3)](#character.seq.general-1.3)

  A [*letter*](#def:letter "16.3.3.3.4.1 General [character.seq.general]") is any of the 26 lowercase or 26uppercase letters in the basic character set[.](#character.seq.general-1.3.sentence-1)

- [(1.4)](#character.seq.general-1.4)

  The[*decimal-point character*](#def:character,decimal-point "16.3.3.3.4.1 General [character.seq.general]") is the locale-specific
(single-byte) character used by functions that convert between a (single-byte)
character sequence and a value of one of the floating-point types[.](#character.seq.general-1.4.sentence-1)
  It is used
in the character sequence to denote the beginning of a fractional part[.](#character.seq.general-1.4.sentence-2)
  It is
represented in [[support]](support "17 Language support library") through [[exec]](exec "33 Execution control library") and [[depr]](depr "Annex D (normative) Compatibility features") by a period,'.',
which is
also its value in the "C" locale[.](#character.seq.general-1.4.sentence-3)

- [(1.5)](#character.seq.general-1.5)

  A[*character sequence*](#def:character_sequence "16.3.3.3.4.1 General [character.seq.general]") is an [array object](dcl.array "9.3.4.5 Arrays [dcl.array]") *A* that
can be declared as*T A*[*N*],
where *T* is any of the typeschar,unsigned char,
orsigned char ([[basic.fundamental]](basic.fundamental "6.9.2 Fundamental types")), optionally qualified by any combination ofconst orvolatile[.](#character.seq.general-1.5.sentence-1)
  The initial elements of the
array have defined contents up to and including an element determined by some
predicate[.](#character.seq.general-1.5.sentence-2)
  A character sequence can be designated by a pointer value*S* that points to its first element[.](#character.seq.general-1.5.sentence-3)

#### [16.3.3.3.4.2](#byte.strings) Byte strings [[byte.strings]](byte.strings)

[1](#byte.strings-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L788)

A [*null-terminated byte string*](#def:ntbs "16.3.3.3.4.2 Byte strings [byte.strings]"),
or ntbs,
is a character sequence whose highest-addressed element
with defined content has the value zero
(the [*terminating null character*](#def:character,terminating_null "16.3.3.3.4.2 Byte strings [byte.strings]"));
no other element in the sequence has the value zero[.](#byte.strings-1.sentence-1)[139](#footnote-139 "Many of the objects manipulated by function signatures declared in <cstring> are character sequences or ntbss. The size of some of these character sequences is limited by a length value, maintained separately from the character sequence.")

[2](#byte.strings-2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L803)

The [*length of an ntbs*](#def:ntbs,length "16.3.3.3.4.2 Byte strings [byte.strings]") is the number of elements that
precede the terminating null character[.](#byte.strings-2.sentence-1)

An [*empty ntbs*](#def:ntbs,empty "16.3.3.3.4.2 Byte strings [byte.strings]") has a length of zero[.](#byte.strings-2.sentence-2)

[3](#byte.strings-3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L810)

The [*value of an ntbs*](#def:ntbs,value "16.3.3.3.4.2 Byte strings [byte.strings]") is the sequence of values of the
elements up to and including the terminating null character[.](#byte.strings-3.sentence-1)

[4](#byte.strings-4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L815)

A [*static ntbs*](#def:ntbs,static "16.3.3.3.4.2 Byte strings [byte.strings]") is an ntbs with
static storage duration[.](#byte.strings-4.sentence-1)[140](#footnote-140 "A string-literal, such as &quot;abc&quot;, is a static ntbs.")

[139)](#footnote-139)[139)](#footnoteref-139)

Many of the objects manipulated by
function signatures declared in[<cstring>](cstring.syn#header:%3ccstring%3e "27.5.1 Header <cstring> synopsis [cstring.syn]") are character sequences or ntbss[.](#footnote-139.sentence-1)

The size of some of these character sequences is limited by
a length value, maintained separately from the character sequence[.](#footnote-139.sentence-2)

[140)](#footnote-140)[140)](#footnoteref-140)

A [*string-literal*](lex.string#nt:string-literal "5.13.5 String literals [lex.string]"), such as"abc",
is a static ntbs[.](#footnote-140.sentence-1)

#### [16.3.3.3.4.3](#multibyte.strings) Multibyte strings [[multibyte.strings]](multibyte.strings)

[1](#multibyte.strings-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L827)

A [*multibyte character*](#def:character,multibyte "16.3.3.3.4.3 Multibyte strings [multibyte.strings]") is
a sequence of one or more bytes representing the
code unit sequence for an encoded character of the
execution character set[.](#multibyte.strings-1.sentence-1)

[2](#multibyte.strings-2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L834)

A [*null-terminated multibyte string*](#def:ntmbs "16.3.3.3.4.3 Multibyte strings [multibyte.strings]"),
or ntmbs,
is an ntbs that constitutes a
sequence of valid multibyte characters, beginning and ending in the initial
shift state[.](#multibyte.strings-2.sentence-1)[141](#footnote-141 "An ntbs that contains characters only from the basic literal character set is also an ntmbs. Each multibyte character then consists of a single byte.")

[3](#multibyte.strings-3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L847)

A [*static ntmbs*](#def:ntmbs,static "16.3.3.3.4.3 Multibyte strings [multibyte.strings]") is an ntmbs with static storage duration[.](#multibyte.strings-3.sentence-1)

[141)](#footnote-141)[141)](#footnoteref-141)

An ntbs that contains characters only from the
basic literal character set is also an ntmbs[.](#footnote-141.sentence-1)

Each multibyte character then
consists of a single byte[.](#footnote-141.sentence-2)

#### [16.3.3.3.5](#customization.point.object) Customization Point Object types [[customization.point.object]](customization.point.object)

[1](#customization.point.object-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L853)

A [*customization point object*](#def:customization_point_object) is a function object ([[function.objects]](function.objects "22.10 Function objects"))
with a literal class type that interacts with program-defined types while
enforcing semantic requirements on that interaction[.](#customization.point.object-1.sentence-1)

[2](#customization.point.object-2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L858)

The type of a customization point object, ignoring cv-qualifiers, shall model[semiregular](concepts.object#concept:semiregular "18.6 Object concepts [concepts.object]") ([[concepts.object]](concepts.object "18.6 Object concepts"))[.](#customization.point.object-2.sentence-1)

[3](#customization.point.object-3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L862)

All instances of a specific customization point object type shall
be equal ([[concepts.equality]](concepts.equality "18.2 Equality preservation"))[.](#customization.point.object-3.sentence-1)

The effects of invoking different instances
of a specific customization point object type on the same arguments
are equivalent[.](#customization.point.object-3.sentence-2)

[4](#customization.point.object-4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L869)

The type T of a customization point object,
ignoring [*cv-qualifier*](dcl.decl.general#nt:cv-qualifier "9.3.1 General [dcl.decl.general]")*s*, shall model[invocable](concept.invocable#concept:invocable "18.7.2 Concept invocable [concept.invocable]")<T&, Args...>,[invocable](concept.invocable#concept:invocable "18.7.2 Concept invocable [concept.invocable]")<const T&, Args...>,[invocable](concept.invocable#concept:invocable "18.7.2 Concept invocable [concept.invocable]")<T, Args...>, and[invocable](concept.invocable#concept:invocable "18.7.2 Concept invocable [concept.invocable]")<const T, Args...> ([[concept.invocable]](concept.invocable "18.7.2 Concept invocable"))
when the types in Args... meet the requirements specified in that
customization point object's definition[.](#customization.point.object-4.sentence-1)

When the types of Args... do
not meet the customization point object's requirements, T shall not have
a function call operator that participates in overload resolution[.](#customization.point.object-4.sentence-2)

[5](#customization.point.object-5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L881)

For a given customization point object o,
let p be a variable initialized as if by auto p = o;[.](#customization.point.object-5.sentence-1)

Then for any sequence of arguments args...,
the following expressions have effects equivalent to o(args...):

- [(5.1)](#customization.point.object-5.1)

p(args...)

- [(5.2)](#customization.point.object-5.2)

as_const(p)(args...)

- [(5.3)](#customization.point.object-5.3)

std​::​move(p)(args...)

- [(5.4)](#customization.point.object-5.4)

std​::​move(as_const(p))(args...)
