2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-22 05:22:45 +00:00
Files
python/pyste/example/virtual2.h
Bruno da Silva de Oliveira 3d01e6af89 no message
[SVN r18067]
2003-03-23 18:29:11 +00:00

22 lines
230 B
C++

namespace virtual2 {
struct A
{
virtual int f1() { return 10; }
};
struct B: A
{
virtual int f2() { return 20; }
};
int call(A*a)
{
int r = a->f1();
B* b = dynamic_cast<B*>(a);
return r + b->f2();
}
}