tmp/tmpay_jbyg9/{from.md → to.md}
RENAMED
|
@@ -6,20 +6,20 @@ required as the result of the conversion (call it `A`; see
|
|
| 6 |
[[dcl.init]], [[over.match.conv]], and [[over.match.ref]] for the
|
| 7 |
determination of that type) as described in [[temp.deduct.type]].
|
| 8 |
|
| 9 |
If `P` is a reference type, the type referred to by `P` is used in place
|
| 10 |
of `P` for type deduction and for any further references to or
|
| 11 |
-
transformations of `P` in the remainder of this
|
| 12 |
|
| 13 |
If `A` is not a reference type:
|
| 14 |
|
| 15 |
- If `P` is an array type, the pointer type produced by the
|
| 16 |
-
array-to-pointer standard conversion
|
| 17 |
-
|
| 18 |
- If `P` is a function type, the pointer type produced by the
|
| 19 |
-
function-to-pointer standard conversion
|
| 20 |
-
|
| 21 |
- If `P` is a cv-qualified type, the top-level cv-qualifiers of `P`’s
|
| 22 |
type are ignored for type deduction.
|
| 23 |
|
| 24 |
If `A` is a cv-qualified type, the top-level cv-qualifiers of `A`’s type
|
| 25 |
are ignored for type deduction. If `A` is a reference type, the type
|
|
@@ -28,41 +28,18 @@ referred to by `A` is used for type deduction.
|
|
| 28 |
In general, the deduction process attempts to find template argument
|
| 29 |
values that will make the deduced `A` identical to `A`. However, there
|
| 30 |
are four cases that allow a difference:
|
| 31 |
|
| 32 |
- If the original `A` is a reference type, `A` can be more cv-qualified
|
| 33 |
-
than the deduced `A` (i.e., the type referred to by the reference)
|
| 34 |
- If the original `A` is a function pointer type, `A` can be “pointer to
|
| 35 |
-
function” even if the deduced `A` is “pointer to noexcept function”.
|
| 36 |
-
- If the original `A` is a pointer
|
| 37 |
“pointer to member of type function” even if the deduced `A` is
|
| 38 |
-
“pointer to member of type noexcept function”.
|
| 39 |
-
- The deduced `A` can be another pointer or pointer
|
| 40 |
can be converted to `A` via a qualification conversion.
|
| 41 |
|
| 42 |
These alternatives are considered only if type deduction would otherwise
|
| 43 |
fail. If they yield more than one possible deduced `A`, the type
|
| 44 |
deduction fails.
|
| 45 |
|
| 46 |
-
When the deduction process requires a qualification conversion for a
|
| 47 |
-
pointer or pointer to member type as described above, the following
|
| 48 |
-
process is used to determine the deduced template argument values:
|
| 49 |
-
|
| 50 |
-
If `A` is a type
|
| 51 |
-
|
| 52 |
-
and `P` is a type
|
| 53 |
-
|
| 54 |
-
then the cv-unqualified `T1` and `T2` are used as the types of `A` and
|
| 55 |
-
`P` respectively for type deduction.
|
| 56 |
-
|
| 57 |
-
[*Example 1*:
|
| 58 |
-
|
| 59 |
-
``` cpp
|
| 60 |
-
struct A {
|
| 61 |
-
template <class T> operator T***();
|
| 62 |
-
};
|
| 63 |
-
A a;
|
| 64 |
-
const int * const * const * p1 = a; // T is deduced as int, not const int
|
| 65 |
-
```
|
| 66 |
-
|
| 67 |
-
— *end example*]
|
| 68 |
-
|
|
|
|
| 6 |
[[dcl.init]], [[over.match.conv]], and [[over.match.ref]] for the
|
| 7 |
determination of that type) as described in [[temp.deduct.type]].
|
| 8 |
|
| 9 |
If `P` is a reference type, the type referred to by `P` is used in place
|
| 10 |
of `P` for type deduction and for any further references to or
|
| 11 |
+
transformations of `P` in the remainder of this subclause.
|
| 12 |
|
| 13 |
If `A` is not a reference type:
|
| 14 |
|
| 15 |
- If `P` is an array type, the pointer type produced by the
|
| 16 |
+
array-to-pointer standard conversion [[conv.array]] is used in place
|
| 17 |
+
of `P` for type deduction; otherwise,
|
| 18 |
- If `P` is a function type, the pointer type produced by the
|
| 19 |
+
function-to-pointer standard conversion [[conv.func]] is used in place
|
| 20 |
+
of `P` for type deduction; otherwise,
|
| 21 |
- If `P` is a cv-qualified type, the top-level cv-qualifiers of `P`’s
|
| 22 |
type are ignored for type deduction.
|
| 23 |
|
| 24 |
If `A` is a cv-qualified type, the top-level cv-qualifiers of `A`’s type
|
| 25 |
are ignored for type deduction. If `A` is a reference type, the type
|
|
|
|
| 28 |
In general, the deduction process attempts to find template argument
|
| 29 |
values that will make the deduced `A` identical to `A`. However, there
|
| 30 |
are four cases that allow a difference:
|
| 31 |
|
| 32 |
- If the original `A` is a reference type, `A` can be more cv-qualified
|
| 33 |
+
than the deduced `A` (i.e., the type referred to by the reference).
|
| 34 |
- If the original `A` is a function pointer type, `A` can be “pointer to
|
| 35 |
+
function” even if the deduced `A` is “pointer to `noexcept` function”.
|
| 36 |
+
- If the original `A` is a pointer-to-member-function type, `A` can be
|
| 37 |
“pointer to member of type function” even if the deduced `A` is
|
| 38 |
+
“pointer to member of type `noexcept` function”.
|
| 39 |
+
- The deduced `A` can be another pointer or pointer-to-member type that
|
| 40 |
can be converted to `A` via a qualification conversion.
|
| 41 |
|
| 42 |
These alternatives are considered only if type deduction would otherwise
|
| 43 |
fail. If they yield more than one possible deduced `A`, the type
|
| 44 |
deduction fails.
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|