tmp/tmp2tlxv_kv/{from.md → to.md}
RENAMED
|
@@ -16,23 +16,28 @@ If `A` is not a reference type:
|
|
| 16 |
array-to-pointer standard conversion ([[conv.array]]) is used in
|
| 17 |
place 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
|
| 20 |
place of `P` for type deduction; otherwise,
|
| 21 |
-
- If `P` is a cv-qualified type, the top
|
| 22 |
type are ignored for type deduction.
|
| 23 |
|
| 24 |
-
If `A` is a cv-qualified type, the top
|
| 25 |
are ignored for type deduction. If `A` is a reference type, the type
|
| 26 |
referred to by `A` is used for type deduction.
|
| 27 |
|
| 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
|
| 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 |
- The deduced `A` can be another pointer or pointer to member type that
|
| 35 |
can be converted to `A` via a qualification conversion.
|
| 36 |
|
| 37 |
These alternatives are considered only if type deduction would otherwise
|
| 38 |
fail. If they yield more than one possible deduced `A`, the type
|
|
@@ -44,16 +49,20 @@ process is used to determine the deduced template argument values:
|
|
| 44 |
|
| 45 |
If `A` is a type
|
| 46 |
|
| 47 |
and `P` is a type
|
| 48 |
|
| 49 |
-
|
| 50 |
-
respectively for type deduction.
|
|
|
|
|
|
|
| 51 |
|
| 52 |
``` cpp
|
| 53 |
struct A {
|
| 54 |
template <class T> operator T***();
|
| 55 |
};
|
| 56 |
A a;
|
| 57 |
const int * const * const * p1 = a; // T is deduced as int, not const int
|
| 58 |
```
|
| 59 |
|
|
|
|
|
|
|
|
|
| 16 |
array-to-pointer standard conversion ([[conv.array]]) is used in
|
| 17 |
place 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
|
| 20 |
place 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
|
| 26 |
referred to by `A` is used for type deduction.
|
| 27 |
|
| 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
|
|
|
|
| 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 |
+
|