First page Back Continue Last page Graphics
fig13_07.cpp
(1 of 3)
1 // Fig. 13.7: fig13_07.cpp
2 // Demonstrating auto_ptr.
3 #include <iostream>
4
5 using std::cout;
6 using std::endl;
7
8 #include <memory>
9
10 using std::auto_ptr; // auto_ptr class definition
11
12 class Integer {
13
14 public:
15
16 // Integer constructor
17 Integer( int i = 0 )
18 : value( i )
19 {
20 cout << "Constructor for Integer " << value << endl;
21
22 } // end Integer constructor
23