-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path18.27.txt
More file actions
37 lines (32 loc) · 782 Bytes
/
18.27.txt
File metadata and controls
37 lines (32 loc) · 782 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
int ival;
double dval;
void MI::foo(double cval)
{
int dval;
// a)
// void Base1::print(int) const visible
// Base1::ival visible
// Base1::dval visible
// Base1::cval visible
// void Derived::print(std::string) const visible
// Derived::sval visible
// Derived::dval visible
// void Base2::print(double) const visible
// Base2::fval visible
// void MI::print(std::vector<double>) visible
// MI::ival visible
// MI::dvec visible
// cval visible (parameter)
// dval visible (local variable)
// any unqualified uses of print, ival, dval, cval are an error
// b)
// print, ival and dval are visible from more than one base class
// c)
dval = Base1::dval + Derived::dval;
// d)
if (!dvec.empty())
fval = dvec.back();
// e)
if (!sval.empty())
sval.front() = Base1::cval;
}