mirror of
https://github.com/boostorg/python.git
synced 2026-01-21 05:02:17 +00:00
26 lines
315 B
C++
26 lines
315 B
C++
namespace virtual_ {
|
|
|
|
struct C
|
|
{
|
|
public:
|
|
virtual int f()
|
|
{
|
|
return f_abs();
|
|
}
|
|
|
|
const char* get_name()
|
|
{
|
|
return name();
|
|
}
|
|
|
|
protected:
|
|
virtual int f_abs() = 0;
|
|
|
|
private:
|
|
virtual const char* name() { return "C"; }
|
|
};
|
|
|
|
inline int call_f(C& c) { return c.f(); }
|
|
|
|
}
|