2 Matching Annotations
- Apr 2022
-
www.learncpp.com www.learncpp.com
-
Because std::unique_ptr is designed with move semantics in mind, copy initialization and copy assignment are disabled. If you want to transfer the contents managed by std::unique_ptr, you must use move semantics.
std::unique_ptr
可以使用 copy 初始化吗?
-
-
www.learncpp.com www.learncpp.com
-
the goal of the move constructor and move assignment is to move ownership of the resources from one object to another (which is typically much less expensive than making a copy).
move constructor 和 move assignment 的目的是什么?
-