[temp.mem.class]

# 13 Templates [[temp]](./#temp)

## 13.7 Template declarations [[temp.decls]](temp.decls#temp.mem.class)

### 13.7.2 Class templates [[temp.class]](temp.class#temp.mem.class)

#### 13.7.2.4 Member classes of class templates [temp.mem.class]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/templates.tex#L2880)

A member class of a class template may be defined outside the class template
definition in which it is declared[.](#1.sentence-1)

[*Note [1](#note-1)*:

The member class must be defined before its first use that requires
an instantiation ([[temp.inst]](temp.inst "13.9.2 Implicit instantiation"))[.](#1.sentence-2)

For example,template<class T> struct A {class B;};
A<int>::B* b1; // OK, requires A to be defined but not A​::​Btemplate<class T> class A<T>::B { };
A<int>::B b2; // OK, requires A​::​B to be defined

â *end note*]
