我了解到STL可以禁止程序员将auto_ptr放入容器中.例如,以下代码无法编译:
auto_ptr<int> a(new int(10)); vector<auto_ptr<int> > v; v.push_back(a);
auto_ptr有复制构造函数,为什么这段代码甚至可以编译?
c++ stl auto-ptr
auto-ptr ×1
c++ ×1
stl ×1