tmp/tmphquii6bb/{from.md → to.md}
RENAMED
|
@@ -1,38 +1,38 @@
|
|
| 1 |
### CV-qualifiers <a id="basic.type.qualifier">[[basic.type.qualifier]]</a>
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
[[dcl.name]], or *new-type-id* [[expr.new]] when the object is created.
|
| 12 |
|
| 13 |
- A *const object* is an object of type `const T` or a non-mutable
|
| 14 |
subobject of a const object.
|
| 15 |
- A *volatile object* is an object of type `volatile T` or a subobject
|
| 16 |
of a volatile object.
|
| 17 |
- A *const volatile object* is an object of type `const volatile T`, a
|
| 18 |
non-mutable subobject of a const volatile object, a const subobject of
|
| 19 |
a volatile object, or a non-mutable volatile subobject of a const
|
| 20 |
object.
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
|
|
|
| 25 |
|
| 26 |
Except for array types, a compound type [[basic.compound]] is not
|
| 27 |
cv-qualified by the cv-qualifiers (if any) of the types from which it is
|
| 28 |
compounded.
|
| 29 |
|
| 30 |
An array type whose elements are cv-qualified is also considered to have
|
| 31 |
the same cv-qualifications as its elements.
|
| 32 |
|
| 33 |
-
[*Note
|
| 34 |
underlying element type, so the notation “cv `T`”, where `T` is an array
|
| 35 |
type, refers to an array whose elements are so-qualified
|
| 36 |
[[dcl.array]]. — *end note*]
|
| 37 |
|
| 38 |
[*Example 1*:
|
|
@@ -47,12 +47,12 @@ const CA arr2 = { 0 };
|
|
| 47 |
The type of both `arr1` and `arr2` is “array of 5 `const char`”, and the
|
| 48 |
array type is considered to be const-qualified.
|
| 49 |
|
| 50 |
— *end example*]
|
| 51 |
|
| 52 |
-
[*Note
|
| 53 |
-
types that have *cv-qualifier*s. — *end note*]
|
| 54 |
|
| 55 |
There is a partial ordering on cv-qualifiers, so that a type can be said
|
| 56 |
to be *more cv-qualified* than another. [[basic.type.qualifier.rel]]
|
| 57 |
shows the relations that constitute this ordering.
|
| 58 |
|
|
|
|
| 1 |
### CV-qualifiers <a id="basic.type.qualifier">[[basic.type.qualifier]]</a>
|
| 2 |
|
| 3 |
+
Each type other than a function or reference type is part of a group of
|
| 4 |
+
four distinct, but related, types: a *cv-unqualified* version, a
|
| 5 |
+
*const-qualified* version, a *volatile-qualified* version, and a
|
| 6 |
+
*const-volatile-qualified* version. The types in each such group shall
|
| 7 |
+
have the same representation and alignment requirements
|
| 8 |
+
[[basic.align]].[^21]
|
| 9 |
+
|
| 10 |
+
A function or reference type is always cv-unqualified.
|
|
|
|
| 11 |
|
| 12 |
- A *const object* is an object of type `const T` or a non-mutable
|
| 13 |
subobject of a const object.
|
| 14 |
- A *volatile object* is an object of type `volatile T` or a subobject
|
| 15 |
of a volatile object.
|
| 16 |
- A *const volatile object* is an object of type `const volatile T`, a
|
| 17 |
non-mutable subobject of a const volatile object, a const subobject of
|
| 18 |
a volatile object, or a non-mutable volatile subobject of a const
|
| 19 |
object.
|
| 20 |
|
| 21 |
+
[*Note 1*: The type of an object [[intro.object]] includes the
|
| 22 |
+
*cv-qualifier*s specified in the *decl-specifier-seq* [[dcl.spec]],
|
| 23 |
+
*declarator* [[dcl.decl]], *type-id* [[dcl.name]], or *new-type-id*
|
| 24 |
+
[[expr.new]] when the object is created. — *end note*]
|
| 25 |
|
| 26 |
Except for array types, a compound type [[basic.compound]] is not
|
| 27 |
cv-qualified by the cv-qualifiers (if any) of the types from which it is
|
| 28 |
compounded.
|
| 29 |
|
| 30 |
An array type whose elements are cv-qualified is also considered to have
|
| 31 |
the same cv-qualifications as its elements.
|
| 32 |
|
| 33 |
+
[*Note 2*: Cv-qualifiers applied to an array type attach to the
|
| 34 |
underlying element type, so the notation “cv `T`”, where `T` is an array
|
| 35 |
type, refers to an array whose elements are so-qualified
|
| 36 |
[[dcl.array]]. — *end note*]
|
| 37 |
|
| 38 |
[*Example 1*:
|
|
|
|
| 47 |
The type of both `arr1` and `arr2` is “array of 5 `const char`”, and the
|
| 48 |
array type is considered to be const-qualified.
|
| 49 |
|
| 50 |
— *end example*]
|
| 51 |
|
| 52 |
+
[*Note 3*: See [[dcl.fct]] and [[over.match.funcs]] regarding
|
| 53 |
+
function types that have *cv-qualifier*s. — *end note*]
|
| 54 |
|
| 55 |
There is a partial ordering on cv-qualifiers, so that a type can be said
|
| 56 |
to be *more cv-qualified* than another. [[basic.type.qualifier.rel]]
|
| 57 |
shows the relations that constitute this ordering.
|
| 58 |
|