这个例子是从Stroustup的书,第三版,第14.4.2节采取: void f (Point p1, Point p2, auto_ptr<Circle> pc, Shape* pb)
{
auto_ptr<Shape> p (new Rectangle(p1 ,p2));
auto_ptr<Shape> pbox(pb);
p->rotate(45);
我相信有从Stroustup的薄提取这个代码片断一个错字,在其368页: template <class X> class std::auto_ptr
{
template <class Y> struct auto_ptr_ref { /* ... */ }; // helper class
X * ptr;
public :
typedef X ele