tmp/tmpakenqtja/{from.md → to.md}
RENAMED
|
@@ -15,17 +15,16 @@ Compound types can be constructed in the following ways:
|
|
| 15 |
a set of types, enumerations and functions for manipulating these
|
| 16 |
objects [[class.mfct]], and a set of restrictions on the access to
|
| 17 |
these entities [[class.access]];
|
| 18 |
- *unions*, which are classes capable of containing objects of different
|
| 19 |
types at different times, [[class.union]];
|
| 20 |
-
- *enumerations*, which comprise a set of named constant values
|
| 21 |
-
distinct enumeration constitutes a different *enumerated type*,
|
| 22 |
[[dcl.enum]];
|
| 23 |
-
- *pointers to non-static class members*,
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
|
| 28 |
These methods of constructing types can be applied recursively;
|
| 29 |
restrictions are mentioned in [[dcl.meaning]]. Constructing a type such
|
| 30 |
that the number of bytes in its object representation exceeds the
|
| 31 |
maximum value representable in the type `std::size_t` [[support.types]]
|
|
@@ -56,28 +55,29 @@ allowed although there are restrictions on what can be done with them
|
|
| 56 |
- the *null pointer value* for that type, or
|
| 57 |
- an *invalid pointer value*.
|
| 58 |
|
| 59 |
A value of a pointer type that is a pointer to or past the end of an
|
| 60 |
object *represents the address* of the first byte in memory
|
| 61 |
-
[[intro.memory]] occupied by the object
|
| 62 |
-
|
| 63 |
-
|
|
|
|
| 64 |
|
| 65 |
[*Note 2*: A pointer past the end of an object [[expr.add]] is not
|
| 66 |
-
considered to point to an unrelated object of the object’s type
|
| 67 |
-
|
| 68 |
-
the storage it denotes reaches the end of its storage
|
| 69 |
-
[[basic.stc]]. — *end note*]
|
| 70 |
|
| 71 |
-
For purposes of pointer arithmetic [[expr.add]] and comparison
|
| 72 |
-
[[expr.rel]], [[expr.eq]]
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
[[basic.align]].
|
| 80 |
|
| 81 |
[*Note 3*: Pointers to over-aligned types [[basic.align]] have no
|
| 82 |
special representation, but their range of valid values is restricted by
|
| 83 |
the extended alignment requirement. — *end note*]
|
|
@@ -86,13 +86,12 @@ Two objects *a* and *b* are *pointer-interconvertible* if:
|
|
| 86 |
|
| 87 |
- they are the same object, or
|
| 88 |
- one is a union object and the other is a non-static data member of
|
| 89 |
that object [[class.union]], or
|
| 90 |
- one is a standard-layout class object and the other is the first
|
| 91 |
-
non-static data member of that object
|
| 92 |
-
|
| 93 |
-
[[class.mem]], or
|
| 94 |
- there exists an object *c* such that *a* and *c* are
|
| 95 |
pointer-interconvertible, and *c* and *b* are
|
| 96 |
pointer-interconvertible.
|
| 97 |
|
| 98 |
If two objects are pointer-interconvertible, then they have the same
|
|
@@ -101,10 +100,15 @@ the other via a `reinterpret_cast` [[expr.reinterpret.cast]].
|
|
| 101 |
|
| 102 |
[*Note 4*: An array object and its first element are not
|
| 103 |
pointer-interconvertible, even though they have the same
|
| 104 |
address. — *end note*]
|
| 105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
A pointer to cv `void` can be used to point to objects of unknown type.
|
| 107 |
Such a pointer shall be able to hold any object pointer. An object of
|
| 108 |
-
type cv `void
|
| 109 |
-
requirements as cv `char
|
| 110 |
|
|
|
|
| 15 |
a set of types, enumerations and functions for manipulating these
|
| 16 |
objects [[class.mfct]], and a set of restrictions on the access to
|
| 17 |
these entities [[class.access]];
|
| 18 |
- *unions*, which are classes capable of containing objects of different
|
| 19 |
types at different times, [[class.union]];
|
| 20 |
+
- *enumerations*, which comprise a set of named constant values,
|
|
|
|
| 21 |
[[dcl.enum]];
|
| 22 |
+
- *pointers to non-static class members*,[^19] which identify members of
|
| 23 |
+
a given type within objects of a given class, [[dcl.mptr]]. Pointers
|
| 24 |
+
to data members and pointers to member functions are collectively
|
| 25 |
+
called *pointer-to-member* types.
|
| 26 |
|
| 27 |
These methods of constructing types can be applied recursively;
|
| 28 |
restrictions are mentioned in [[dcl.meaning]]. Constructing a type such
|
| 29 |
that the number of bytes in its object representation exceeds the
|
| 30 |
maximum value representable in the type `std::size_t` [[support.types]]
|
|
|
|
| 55 |
- the *null pointer value* for that type, or
|
| 56 |
- an *invalid pointer value*.
|
| 57 |
|
| 58 |
A value of a pointer type that is a pointer to or past the end of an
|
| 59 |
object *represents the address* of the first byte in memory
|
| 60 |
+
[[intro.memory]] occupied by the object[^20]
|
| 61 |
+
|
| 62 |
+
or the first byte in memory after the end of the storage occupied by the
|
| 63 |
+
object, respectively.
|
| 64 |
|
| 65 |
[*Note 2*: A pointer past the end of an object [[expr.add]] is not
|
| 66 |
+
considered to point to an unrelated object of the object’s type, even if
|
| 67 |
+
the unrelated object is located at that address. A pointer value becomes
|
| 68 |
+
invalid when the storage it denotes reaches the end of its storage
|
| 69 |
+
duration; see [[basic.stc]]. — *end note*]
|
| 70 |
|
| 71 |
+
For purposes of pointer arithmetic [[expr.add]] and comparison
|
| 72 |
+
[[expr.rel]], [[expr.eq]], a pointer past the end of the last element of
|
| 73 |
+
an array `x` of n elements is considered to be equivalent to a pointer
|
| 74 |
+
to a hypothetical array element n of `x` and an object of type `T` that
|
| 75 |
+
is not an array element is considered to belong to an array with one
|
| 76 |
+
element of type `T`. The value representation of pointer types is
|
| 77 |
+
*implementation-defined*. Pointers to layout-compatible types shall have
|
| 78 |
+
the same value representation and alignment requirements
|
| 79 |
[[basic.align]].
|
| 80 |
|
| 81 |
[*Note 3*: Pointers to over-aligned types [[basic.align]] have no
|
| 82 |
special representation, but their range of valid values is restricted by
|
| 83 |
the extended alignment requirement. — *end note*]
|
|
|
|
| 86 |
|
| 87 |
- they are the same object, or
|
| 88 |
- one is a union object and the other is a non-static data member of
|
| 89 |
that object [[class.union]], or
|
| 90 |
- one is a standard-layout class object and the other is the first
|
| 91 |
+
non-static data member of that object or any base class subobject of
|
| 92 |
+
that object [[class.mem]], or
|
|
|
|
| 93 |
- there exists an object *c* such that *a* and *c* are
|
| 94 |
pointer-interconvertible, and *c* and *b* are
|
| 95 |
pointer-interconvertible.
|
| 96 |
|
| 97 |
If two objects are pointer-interconvertible, then they have the same
|
|
|
|
| 100 |
|
| 101 |
[*Note 4*: An array object and its first element are not
|
| 102 |
pointer-interconvertible, even though they have the same
|
| 103 |
address. — *end note*]
|
| 104 |
|
| 105 |
+
A byte of storage *b* is *reachable through* a pointer value that points
|
| 106 |
+
to an object *x* if there is an object *y*, pointer-interconvertible
|
| 107 |
+
with *x*, such that *b* is within the storage occupied by *y*, or the
|
| 108 |
+
immediately-enclosing array object if *y* is an array element.
|
| 109 |
+
|
| 110 |
A pointer to cv `void` can be used to point to objects of unknown type.
|
| 111 |
Such a pointer shall be able to hold any object pointer. An object of
|
| 112 |
+
type “pointer to cv `void`” shall have the same representation and
|
| 113 |
+
alignment requirements as an object of type “pointer to cv `char`”.
|
| 114 |
|