[ create a new paste ] login | about

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

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

class x{
public:
        x()     { std::cout << "x()"  << std::endl; }
        ~x(){ std::cout << "~x()" << std::endl; }
 
        void foo(){ }
};
 
int main(){
 
        std::auto_ptr<x> p_x(new x);
        p_x->foo();
        return 0;
}


Output:
1
2
x()
~x()


Create a new paste based on this one


Comments: