| 1 |
template <typename Type1> |
| 2 |
class Outer |
| 3 |
{ |
| 4 |
public: |
| 5 |
template <typename Type2> // template class |
| 6 |
class Inner; |
| 7 |
|
| 8 |
template <typename Type> // template function |
| 9 |
Type process(Type const &p1, Type const &p2); |
| 10 |
}; |
| 11 |
|
| 12 |
// template class member |
| 13 |
template <typename Type1> template <typename Type2> |
| 14 |
|
| 15 |
class Outer<Type1>::Inner // no Type2 with `Inner' |
| 16 |
{ |
| 17 |
public: |
| 18 |
Type1 |
| 19 |
variable1; |
| 20 |
Type2 |
| 21 |
variable2; |
| 22 |
}; |
| 23 |
// template function member |
| 24 |
template <typename Type1> template <typename Type> |
| 25 |
Type Outer<Type1>::process(Type const &p1, Type const &p2) |
| 26 |
{ |
| 27 |
Type |
| 28 |
result; |
| 29 |
return result; |
| 30 |
} |