tmp/tmpyl2y2ow9/{from.md → to.md}
RENAMED
|
@@ -1,19 +1,23 @@
|
|
| 1 |
-
## Nested type names <a id="class.nested.type">[[class.nested.type]]</a>
|
| 2 |
|
| 3 |
Type names obey exactly the same scope rules as other names. In
|
| 4 |
particular, type names defined within a class definition cannot be used
|
| 5 |
outside their class without qualification.
|
| 6 |
|
|
|
|
|
|
|
| 7 |
``` cpp
|
| 8 |
struct X {
|
| 9 |
typedef int I;
|
| 10 |
-
class Y {
|
| 11 |
I a;
|
| 12 |
};
|
| 13 |
|
| 14 |
I b; // error
|
| 15 |
Y c; // error
|
| 16 |
X::Y d; // OK
|
| 17 |
X::I e; // OK
|
| 18 |
```
|
| 19 |
|
|
|
|
|
|
|
|
|
| 1 |
+
### Nested type names <a id="class.nested.type">[[class.nested.type]]</a>
|
| 2 |
|
| 3 |
Type names obey exactly the same scope rules as other names. In
|
| 4 |
particular, type names defined within a class definition cannot be used
|
| 5 |
outside their class without qualification.
|
| 6 |
|
| 7 |
+
[*Example 1*:
|
| 8 |
+
|
| 9 |
``` cpp
|
| 10 |
struct X {
|
| 11 |
typedef int I;
|
| 12 |
+
class Y { ... };
|
| 13 |
I a;
|
| 14 |
};
|
| 15 |
|
| 16 |
I b; // error
|
| 17 |
Y c; // error
|
| 18 |
X::Y d; // OK
|
| 19 |
X::I e; // OK
|
| 20 |
```
|
| 21 |
|
| 22 |
+
— *end example*]
|
| 23 |
+
|