summaryrefslogtreecommitdiff
path: root/c,cc/derive_from_templated_class.cc
blob: 3e292c8e34e709b3f7e5ddee04d0ebc3955bde9d (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
30
31
#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;
}