摘要: 使用 (copy|move) & swap 方式 没有处理自赋值 无父类示例 class Widget { public: Widget() { this->x = new int; std::cout << (this) << " "; std::cout << "Constructor call 阅读全文
posted @ 2024-05-04 02:05 sgsg1288 阅读(2) 评论(0) 推荐(0) 编辑
摘要: std::move和std::forward仅仅是执行转换(cast)的函数(事实上是函数模板)。std::move无条件的将它的实参转换为右值,而std::forward只在特定情况满足时下进行转换。 std::move template <class _Ty> constexpr remove_ 阅读全文
posted @ 2024-05-03 19:46 sgsg1288 阅读(3) 评论(0) 推荐(0) 编辑