mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-12 21:56:54 +00:00
add missing virtual destructors
This commit is contained in:
parent
13bbe2e1bb
commit
9cb8fd7a97
@ -2,18 +2,21 @@ includes = ["vector"]
|
||||
definitions = '''
|
||||
class A {
|
||||
public:
|
||||
virtual ~A() = default;
|
||||
virtual void myfunc() {}
|
||||
int int_a;
|
||||
};
|
||||
|
||||
class B : public A {
|
||||
public:
|
||||
virtual ~B() = default;
|
||||
virtual void myfunc() override {}
|
||||
std::vector<int> vec_b;
|
||||
};
|
||||
|
||||
class C : public B {
|
||||
public:
|
||||
virtual ~C() = default;
|
||||
virtual void myfunc() override {}
|
||||
int int_c;
|
||||
};
|
||||
|
@ -2,24 +2,28 @@ includes = ["vector"]
|
||||
definitions = '''
|
||||
class Root {
|
||||
public:
|
||||
virtual ~Root() = default;
|
||||
virtual void myfunc() {}
|
||||
int int_root;
|
||||
};
|
||||
|
||||
class Middle1 : public Root {
|
||||
public:
|
||||
virtual ~Middle1() = default;
|
||||
virtual void myfunc() override {}
|
||||
std::vector<int> vec_middle1;
|
||||
};
|
||||
|
||||
class Middle2 : public Root {
|
||||
public:
|
||||
virtual ~Middle2() = default;
|
||||
virtual void myfunc() override {}
|
||||
std::vector<int> vec_middle2;
|
||||
};
|
||||
|
||||
class Child : public Middle1, public Middle2 {
|
||||
public:
|
||||
virtual ~Child() = default;
|
||||
virtual void myfunc() override {}
|
||||
int int_child;
|
||||
};
|
||||
|
@ -7,12 +7,14 @@ definitions = '''
|
||||
|
||||
class B : public A {
|
||||
public:
|
||||
virtual ~B() = default;
|
||||
virtual void myfunc() {}
|
||||
std::vector<int> vec_b;
|
||||
};
|
||||
|
||||
class C : public B {
|
||||
public:
|
||||
virtual ~C() = default;
|
||||
virtual void myfunc() override {}
|
||||
int int_c;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user