classes containing a sequence of objects of various types
(Clause [class]), a set of types, enumerations and functions for
manipulating these objects ([class.mfct]), and a set of restrictions
on the access to these entities (Clause [class.access]);
Constructing a type such that the number of
bytes in its object representation exceeds the maximum value representable in
the type std::size_t ([support.types]) is ill-formed.
A value of a
pointer type
that is a pointer to or past the end of an object
represents the address of
the first byte in memory ([intro.memory]) occupied by the object54
or the first byte in memory
after the end of the storage occupied by the object,
respectively.
A pointer past the end of an object ([expr.add])
is not considered to point to an unrelated object
of the object's type
that might be located at that address.
A pointer value becomes invalid
when the storage it denotes
reaches the end of its storage duration;
see [basic.stc].
—end note
]
For purposes of pointer arithmetic ([expr.add])
and comparison ([expr.rel], [expr.eq]),
a pointer past the end of the last element of
an array x of n elements
is considered to be equivalent to
a pointer to a hypothetical element x[n].
The value representation of
pointer types is implementation-defined.
Pointers to
layout-compatible types shall
have the same value representation and alignment
requirements ([basic.align]).
Pointers to over-aligned types ([basic.align]) have no special
representation, but their range of valid values is restricted by the extended
alignment requirement.
one is a standard-layout class object and
the other is the first non-static data member of that object, or,
if the object has no non-static data members,
the first base class subobject of that object ([class.mem]), or
there exists an object c such that
a and c are pointer-interconvertible, and
c and b are pointer-interconvertible.
If two objects are pointer-interconvertible,
then they have the same address,
and it is possible to obtain a pointer to one
from a pointer to the other
via a reinterpret_cast ([expr.reinterpret.cast]).