tmp/tmp6x8f3y79/{from.md → to.md}
RENAMED
|
@@ -1,16 +1,21 @@
|
|
| 1 |
#### Member classes of class templates <a id="temp.mem.class">[[temp.mem.class]]</a>
|
| 2 |
|
| 3 |
A member class of a class template may be defined outside the class
|
| 4 |
-
template definition in which it is declared.
|
| 5 |
-
|
| 6 |
-
[
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
``` cpp
|
| 9 |
template<class T> struct A {
|
| 10 |
class B;
|
| 11 |
};
|
| 12 |
A<int>::B* b1; // OK: requires A to be defined but not A::B
|
| 13 |
template<class T> class A<T>::B { };
|
| 14 |
A<int>::B b2; // OK: requires A::B to be defined
|
| 15 |
```
|
| 16 |
|
|
|
|
|
|
|
|
|
| 1 |
#### Member classes of class templates <a id="temp.mem.class">[[temp.mem.class]]</a>
|
| 2 |
|
| 3 |
A member class of a class template may be defined outside the class
|
| 4 |
+
template definition in which it is declared.
|
| 5 |
+
|
| 6 |
+
[*Note 1*:
|
| 7 |
+
|
| 8 |
+
The member class must be defined before its first use that requires an
|
| 9 |
+
instantiation ([[temp.inst]]). For example,
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
template<class T> struct A {
|
| 13 |
class B;
|
| 14 |
};
|
| 15 |
A<int>::B* b1; // OK: requires A to be defined but not A::B
|
| 16 |
template<class T> class A<T>::B { };
|
| 17 |
A<int>::B b2; // OK: requires A::B to be defined
|
| 18 |
```
|
| 19 |
|
| 20 |
+
— *end note*]
|
| 21 |
+
|