yo/classtemplates/examples/templatemember.cc
raw| 1 | template <typename Type1> |
| 2 | class Outer |
| 3 | { |
| 4 | public: |
| 5 | template <typename Type2> // template class |
| 6 | class Inner |
| 7 | { |
| 8 | public: |
| 9 | Type1 |
| 10 | variable1; |
| 11 | Type2 |
| 12 | variable2; |
| 13 | }; |
| 14 | |
| 15 | template <typename Type3> // template function |
| 16 | Type3 process(Type3 const &p1, Type3 const &p2) |
| 17 | { |
| 18 | Type3 |
| 19 | result; |
| 20 | |
| 21 | return result; |
| 22 | } |
| 23 | }; |