tmp/tmpwrq4n_sw/{from.md → to.md}
RENAMED
|
@@ -1,25 +1,41 @@
|
|
| 1 |
## Type equivalence <a id="temp.type">[[temp.type]]</a>
|
| 2 |
|
| 3 |
-
Two *template-id*s
|
| 4 |
|
| 5 |
- their *template-name*s, *operator-function-id*s, or
|
| 6 |
-
*literal-operator-id*s refer to the same template and
|
| 7 |
-
- their corresponding type *template-argument*s are the same type and
|
| 8 |
-
- their corresponding non-type template
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
refer to the same object or function or are both the null pointer
|
| 12 |
-
value and
|
| 13 |
-
- their corresponding non-type *template-argument*s of pointer-to-member
|
| 14 |
-
type refer to the same class member or are both the null member
|
| 15 |
-
pointer value and
|
| 16 |
-
- their corresponding non-type *template-argument*s of reference type
|
| 17 |
-
refer to the same object or function and
|
| 18 |
- their corresponding template *template-argument*s refer to the same
|
| 19 |
template.
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
[*Example 1*:
|
| 22 |
|
| 23 |
``` cpp
|
| 24 |
template<class E, int size> class buffer { ... };
|
| 25 |
buffer<char,2*512> x;
|
|
@@ -49,13 +65,13 @@ X<Z<int> > z;
|
|
| 49 |
|
| 50 |
declares `y` and `z` to be of the same type.
|
| 51 |
|
| 52 |
— *end example*]
|
| 53 |
|
| 54 |
-
If an expression e is type-dependent
|
| 55 |
denotes a unique dependent type. Two such *decltype-specifier*s refer to
|
| 56 |
-
the same type only if their *expression*s are equivalent
|
| 57 |
-
[[temp.over.link]]
|
| 58 |
|
| 59 |
[*Note 1*: However, such a type may be aliased, e.g., by a
|
| 60 |
*typedef-name*. — *end note*]
|
| 61 |
|
|
|
|
| 1 |
## Type equivalence <a id="temp.type">[[temp.type]]</a>
|
| 2 |
|
| 3 |
+
Two *template-id*s are the same if
|
| 4 |
|
| 5 |
- their *template-name*s, *operator-function-id*s, or
|
| 6 |
+
*literal-operator-id*s refer to the same template, and
|
| 7 |
+
- their corresponding type *template-argument*s are the same type, and
|
| 8 |
+
- their corresponding non-type *template-argument*s are
|
| 9 |
+
template-argument-equivalent (see below) after conversion to the type
|
| 10 |
+
of the *template-parameter*, and
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
- their corresponding template *template-argument*s refer to the same
|
| 12 |
template.
|
| 13 |
|
| 14 |
+
Two *template-id*s that are the same refer to the same class, function,
|
| 15 |
+
or variable.
|
| 16 |
+
|
| 17 |
+
Two values are *template-argument-equivalent* if they are of the same
|
| 18 |
+
type and
|
| 19 |
+
|
| 20 |
+
- they are of integral type and their values are the same, or
|
| 21 |
+
- they are of floating-point type and their values are identical, or
|
| 22 |
+
- they are of type `std::nullptr_t`, or
|
| 23 |
+
- they are of enumeration type and their values are the same, [^6] or
|
| 24 |
+
- they are of pointer type and they have the same pointer value, or
|
| 25 |
+
- they are of pointer-to-member type and they refer to the same class
|
| 26 |
+
member or are both the null member pointer value, or
|
| 27 |
+
- they are of reference type and they refer to the same object or
|
| 28 |
+
function, or
|
| 29 |
+
- they are of array type and their corresponding elements are
|
| 30 |
+
template-argument-equivalent, [^7] or
|
| 31 |
+
- they are of union type and either they both have no active member or
|
| 32 |
+
they have the same active member and their active members are
|
| 33 |
+
template-argument-equivalent, or
|
| 34 |
+
- they are of class type and their corresponding direct subobjects and
|
| 35 |
+
reference members are template-argument-equivalent.
|
| 36 |
+
|
| 37 |
[*Example 1*:
|
| 38 |
|
| 39 |
``` cpp
|
| 40 |
template<class E, int size> class buffer { ... };
|
| 41 |
buffer<char,2*512> x;
|
|
|
|
| 65 |
|
| 66 |
declares `y` and `z` to be of the same type.
|
| 67 |
|
| 68 |
— *end example*]
|
| 69 |
|
| 70 |
+
If an expression e is type-dependent [[temp.dep.expr]], `decltype(e)`
|
| 71 |
denotes a unique dependent type. Two such *decltype-specifier*s refer to
|
| 72 |
+
the same type only if their *expression*s are equivalent
|
| 73 |
+
[[temp.over.link]].
|
| 74 |
|
| 75 |
[*Note 1*: However, such a type may be aliased, e.g., by a
|
| 76 |
*typedef-name*. — *end note*]
|
| 77 |
|