2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-20 16:52:15 +00:00
Files
python/pyste/example/virtual2.h
Bruno da Silva de Oliveira c7ea0aacd6 - Lots of fixes in the documentation
- Fixed support for return_opaque_pointer policy


[SVN r18199]
2003-04-08 01:01:32 +00:00

28 lines
355 B
C++

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