jeans chen
we've got them by the balls

接受指针的构造函数为explicit构造函数,所以必须使用初始化的直接形式来创建auto_ptr对象:

auto_ptr<int> pi = new int(1024);//error

auto_ptr<int> pi(new int(1024));//ok:uses direct initialization

 

posted on 2013-07-22 14:10  jeans chen  阅读(133)  评论(0编辑  收藏  举报