swig/Examples/python/import_template/foo.h
Dave Beazley 12a43edc2d The great merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2002-11-30 22:01:28 +00:00

21 lines
361 B
C++

#include "base.h"
template<class T> class Foo : public Base<T> {
public:
Foo() { }
~Foo() { }
virtual void A() {
printf("I'm Foo::A\n");
}
void B() {
printf("I'm Foo::B\n");
}
virtual Base<T> *toBase() {
return static_cast<Base<T> *>(this);
}
static Foo<T> *fromBase(Base<T> *b) {
return dynamic_cast<Foo<T> *>(b);
}
};