C++ Tip 备忘
摘要:1. Functors 的行为不应该取决于调用的次数,应该将operator()声明为const 成员函数。 见<C++ Standard Library> p302 - 3042. auto_ptr不能作为容器的元素,因为执行了copy构造函数后两个auto_ptr并不相等,因为原auto_ptr交出了拥有权。 语言本身是会防止这类误用的。
阅读全文
posted @ 2012-10-09 22:34
浙公网安备 33010602011771号