summaryrefslogtreecommitdiff
path: root/c,cc/derive_from_templated_class.cc
blob: f2529814e18f65b8e960b7d74e7c5f3ef5ee588f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <vector>
#include <iostream>

using namespace std;


template<class T>
class A {
  T m_;
};

template<class T>
class B : public A<T> {
  T n_;
};

template<class T>
void f(vector<B<T>*> v)
{
  for (typename vector<B<T>*>::iterator it = v.begin(); it != v.end(); it++) {
    // do sth
  }
}

int main(void)
{
  vector<B<int>* > v;
}