From 4c0b43133a1bbe728c404d3b27e34b97b2f82b3b Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sat, 16 Aug 2014 21:29:51 +0100 Subject: c++: derive from templated class --- c,cc/derive_from_templated_class.cc | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 c,cc/derive_from_templated_class.cc (limited to 'c,cc') diff --git a/c,cc/derive_from_templated_class.cc b/c,cc/derive_from_templated_class.cc new file mode 100644 index 0000000..3e292c8 --- /dev/null +++ b/c,cc/derive_from_templated_class.cc @@ -0,0 +1,31 @@ +#include +#include + +using namespace std; + + +template +class A { + T m_; +}; + +template +class B : public A { + T n_; +}; + +template +void f(vector*> v) +{ + for (typename vector*>::iterator it = v.begin(); it != v.end(); it++) { + // do sth + } +} + + + +int main(void) +{ + vector* > v; +} + -- cgit v1.2.3