template<class T>
class shared_ptr{
public:
T& operator*( ) const {return *px;}
T* operator->( ) const {return px;}
shared_ptr(T* p) : px(p) { }
private:
T* px;
long* pn;
}
strcut Foo{
void method(void) { }
};
shared_ptr<Foo> sp(new )
Foo f(*sp);
sp->method( );
迭代器,pointer-like classes, 智能指针