Files
  • main.cpp
main.cpp
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
#include <iostream>

class str {
public:
	str() {
		std::cout << "str constructor" << std::endl;
	}
};

class Base {
public:
	Base() {
		std::cout << "Base constructor" << std::endl;
	}

private:
	str bm1, bm2; // base members 1 and 2
};

class Derived : public Base {
public:
	Derived() {
	} // Derived’s ctor is empty — or is it?

private:
	str dm1, dm2, dm3; // derived members 1–3
};

int main() {
	Derived d;
}
gcc version 4.6.3