#include <iostream>
#include <vector>
#include <boost/shared_ptr.hpp>
using namespace std;
using namespace boost;
class ClassA
{
public:
ClassA(){cout << "ClassA()" << endl;}
~ClassA(){cout << "~ClassA()" << endl;}
void hello(){cout << "# hello()" << endl;}
};
vector< shared_ptr<ClassA> > vec;
int main () {
shared_ptr<ClassA> obj(new ClassA());
cout << "* use_count (new): " << obj.use_count() << endl;
vec.push_back(obj);
cout << "* use_count (push): " << obj.use_count() << endl;
obj->hello();
vec.pop_back();
cout << "* use_count (pop): " << obj.use_count() << endl;
obj.reset(new ClassA());
cout << "* use_count (reset): " << obj.use_count() << endl;
return 0;
}