language: C++ 4.7.2 (gcc-4.7.2)
date: 382 days 15 hours ago
link:
visibility: public
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <iostream>
using namespace std;
 
class Base
{
public:
   Base()
   {
      cout << "Base()\n";
   }
 
   Base(int)
   {
      cout << "Base(int)\n";
   }
 
   ~Base()
   {
      cout << "~Base()\n";
   }
 
   Base& operator=(int)
   {
      cout << "Base::operator=(int)\n";
      return *this;
   }
};
 
class Derived : public Base
{
public:
   Derived()
   {
      cout << "Derived()\n";
   }
 
   Derived(int n) : Base(n)
   {
      cout << "Derived(int)\n";
   }
 
   ~Derived()
   {
      cout << "~Derived()\n";
   }
};
 
class Holder
{
public:
   Holder(int n)
   {
      member = n;
   }
 
   Derived member;
};
 
int main(int argc, char* argv[])
{
   cout << "Start\n";
   Holder obj(1);
   cout << "Finish\n";
 
   return 0;
}