阅读须知
学习注意事项
代码风格
#include <iostream>
struct move_only{
move_only() { std::puts("默认构造"); }
move_only(move_only&&)noexcept { std::puts("移动构造"); }
move_only& operator=(move_only&&) noexcept {
std::puts("移动赋值");
return *this;
}
move_only(const move_only&) = delete;
};
int main(){
move_only m{};
char buffer[1024]{} // 全部初始化为 0
}总结
Last updated