tmp/tmp2mblesg4/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### [[temp]]: templates <a id="diff.cpp17.temp">[[diff.cpp17.temp]]</a>
|
| 2 |
+
|
| 3 |
+
**Change:** An *unqualified-id* that is followed by a `<` and for which
|
| 4 |
+
name lookup finds nothing or finds a function will be treated as a
|
| 5 |
+
*template-name* in order to potentially cause argument dependent lookup
|
| 6 |
+
to be performed. **Rationale:** It was problematic to call a function
|
| 7 |
+
template with an explicit template argument list via argument dependent
|
| 8 |
+
lookup because of the need to have a template with the same name visible
|
| 9 |
+
via normal lookup. **Effect on original feature:** Previously valid code
|
| 10 |
+
that uses a function name as the left operand of a `<` operator would
|
| 11 |
+
become ill-formed.
|
| 12 |
+
|
| 13 |
+
``` cpp
|
| 14 |
+
struct A {};
|
| 15 |
+
bool operator<(void (*fp)(), A);
|
| 16 |
+
void f() {}
|
| 17 |
+
int main() {
|
| 18 |
+
A a;
|
| 19 |
+
f < a; // ill-formed; previously well-formed
|
| 20 |
+
(f) < a; // still well formed
|
| 21 |
+
}
|
| 22 |
+
```
|
| 23 |
+
|