mirror of
https://github.com/boostorg/python.git
synced 2026-01-23 17:52:17 +00:00
- Added a new function, no_override. When a member function is specified as "no_override", no virtual wrappers are generated for it, improving performance and letting the code more clean. - There was a bug in which the policy of virtual member functions was being ignored (patch by Roman Sulzhyk). [SVN r18814]
40 lines
424 B
C++
40 lines
424 B
C++
|
|
namespace inherit {
|
|
|
|
template<typename T>
|
|
class A
|
|
{
|
|
public:
|
|
void set(T v) { mData = v; }
|
|
|
|
T get() const { return mData; }
|
|
|
|
private:
|
|
T mData;
|
|
};
|
|
|
|
|
|
class B : public A<int>
|
|
{
|
|
public:
|
|
int go() { return get(); }
|
|
};
|
|
|
|
struct C : B
|
|
{
|
|
enum ab { a = 1, b = 2 };
|
|
int f1() { return 1; }
|
|
int x;
|
|
static int s;
|
|
};
|
|
|
|
struct D : C
|
|
{
|
|
int f2() { return 2; }
|
|
int y;
|
|
};
|
|
|
|
struct X {};
|
|
struct E: X, D {};
|
|
}
|