std::swap 不支持 std::auto_ptr 类型参数
虽然auto_ptr即将成为历史,但公司内的代码还是有大量的使用。
在为一个用pimpl模式实现的class 写swap函数的时候,偶然发现std::swap不支持auto_ptr类型的参数:在gcc 3.4下不能通过编译。
为什么呢?
网上的一个对话给出了答复:https://gcc.gnu.org/ml/libstdc++/2004-11/msg00086.html
Accordi
原创
2016-04-27 03:49:47 ·
353 阅读 ·
0 评论