The Requirements subclauses may describe names that are used to specify
constraints on template arguments.129
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.
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.enumbitmask: int_type {V0=1<<0, V1=1<<1, V2=1<<2, V3=1<<3, …};
inlineconstexprbitmask C0(V0);
inlineconstexprbitmask C1(V1);
inlineconstexprbitmask C2(V2);
inlineconstexprbitmask C3(V3);
⋮
constexprbitmaskoperator&(bitmask X, bitmask Y){returnstatic_cast<bitmask>(static_cast<int_type>(X)&static_cast<int_type>(Y));
}constexprbitmaskoperator|(bitmask X, bitmask Y){returnstatic_cast<bitmask>(static_cast<int_type>(X)|static_cast<int_type>(Y));
}constexprbitmaskoperator^(bitmask X, bitmask Y){returnstatic_cast<bitmask>(static_cast<int_type>(X)^static_cast<int_type>(Y));
}constexprbitmaskoperator~(bitmask X){returnstatic_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;
}
Properties specified as locale-specific
may change during program execution
by a call to setlocale(int, constchar*) ([clocale.syn]), or
by a change to a locale object,
as described in [locales] and [input.output].
The
decimal-point character
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.
It is used
in the character sequence to denote the beginning of a fractional part.
It is
represented in [support] through [exec]
and [depr] by a period,
'.',
which is
also its value in the "C"
locale.
A
character sequence
is an array objectA that
can be declared as
T A[N],
where T is any of the types
char,
unsignedchar,
or
signedchar ([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.
A null-terminated multibyte string,
or ntmbs,
is an ntbs that constitutes a
sequence of valid multibyte characters, beginning and ending in the initial
shift state.133
A customization point object is a function object ([function.objects])
with a literal class type that interacts with program-defined types while
enforcing semantic requirements on that interaction.
The type T of a customization point object,
ignoring cv-qualifiers, shall model
invocable<T&, Args..>,
invocable<const T&, Args..>,
invocable<T, Args..>, and
invocable<const T, Args..> ([concept.invocable])
when the types in Args.. meet the requirements specified in that
customization point object's definition.
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.
For an algorithm function object o,
let S be the corresponding set of function templates.
Then for any sequence of arguments args …,
o(args …) is expression-equivalent to
s(args …),
where the result of name lookup for s is the overload set S.
For the sake of exposition, [support] through [exec]
and [depr] do not describe copy/move constructors, assignment
operators, or (non-virtual) destructors with the same apparent
semantics as those that can be generated
by default ([class.copy.ctor], [class.copy.assign], [class.dtor]).
It is unspecified whether
the implementation provides explicit definitions for such member function
signatures, or for virtual destructors that can be generated by default.
An implementation may
define static or non-static class members, or both, as needed to implement the
semantics of the member functions specified in [support]
through [exec] and [depr].
For the sake of exposition,
some subclauses provide representative declarations, and semantic requirements, for
private members of classes that meet the external specifications of the classes.
The declarations for such members are
followed by a comment that ends with exposition only, as in:
streambuf* sb; / exposition only
Unless otherwise specified,
the requirements on freestanding items for a freestanding implementation
are the same as the corresponding requirements for a hosted implementation,
except that not all of the members of those items are required to be present.
Function declarations and function template declarations
followed by a comment that include freestanding-deleted are
freestanding deleted functions.
On freestanding implementations,
it is implementation-defined
whether each entity introduced by a freestanding deleted function
is a deleted function ([dcl.fct.def.delete]) or
whether the requirements are the same as
the corresponding requirements for a hosted implementation.
Deleted definitions reduce the chance of overload resolution silently changing
when migrating from a freestanding implementation to a hosted implementation.
— end note]
[Example 1: double abs(double j); / freestanding-deleted — end example]
Freestanding annotations follow some additional exposition conventions
that do not impose any additional normative requirements.
Header synopses that begin with a comment containing "all freestanding"
contain no hosted items and no freestanding deleted functions.
Header synopses that begin with a comment containing "mostly freestanding"
contain at least one hosted item or freestanding deleted function.
Classes and class templates followed by a comment
containing "partially freestanding"
contain at least one hosted item or freestanding deleted function.