[ create a new paste ] login | about

Link: http://codepad.org/0aDYVEOB    [ raw code | output | fork ]

C++, pasted on Jul 15:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>
using std::cout;

struct T {
   T() { cout << "*T "; }
   T(T const&) { cout << "*T(T) "; }
   ~T() { cout << "~T() "; }
};

int main() 
{
    T t;
    t = T();
}

// Run this through GCC with -O3 to see:
//   *T *T ~T() ~T() 


Output:
1
*T *T ~T() ~T() 


Create a new paste based on this one


Comments: