-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path18.28.txt
More file actions
39 lines (28 loc) · 962 Bytes
/
18.28.txt
File metadata and controls
39 lines (28 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
struct Base {
void bar(int);
protected:
int ival;
};
struct Derived1 : virtual public Base {
void bar(char);
void foo(char);
protected:
char cval;
};
struct Derived2 : virtual public Base {
void foo(int);
protected:
int ival;
char cval;
};
class VMI : public Derived1, public Derived2 {};
// access through VMI:
// Base::bar needs qualification, defined in both Base and Derived1
// Base::ival needs qualification, defined in both Base and Derived2
// Derived1::bar doesn't need qualification to be accessed
// Derived1::foo needs qualification, defined in both Derived1 and Derived2
// Derived1::cval needs qualification, defined in both Derived1 and Derived2
// Derived2::foo needs qualification, defined in both Derived2 and Derived1
// Derived2::ival doesn't need qualification to be accessed
// Derived2::cval needs qualification, defined in both Derived2 and Derived1
// bar and ival don't need qualification to be accessed through VMI