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
| #include <iostream>
#include <boost/scoped_ptr.hpp>
class A { public: A(int id): id_(id) { std::cout << __PRETTY_FUNCTION__ << std::endl; }
~A() { std::cout << __PRETTY_FUNCTION__ << std::endl; }
int id_;
};
int main(int argc,char* argv[]) { boost::scoped_ptr<A> i(new A(1));
std::cout << i->id_ << std::endl;
return 0; }
|