会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
sgsg-blogs
博客园
首页
新随笔
联系
订阅
管理
2024年5月4日
类的特殊成员函数编写示例
摘要: 使用 (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
阅读(10)
评论(0)
推荐(0)
2024年5月3日
std::move 和 std::forward源码解析
摘要: std::move和std::forward仅仅是执行转换(cast)的函数(事实上是函数模板)。std::move无条件的将它的实参转换为右值,而std::forward只在特定情况满足时下进行转换。 std::move template <class _Ty> constexpr remove_
阅读全文
posted @ 2024-05-03 19:46 sgsg1288
阅读(83)
评论(0)
推荐(0)
公告