3 Matching Annotations
  1. Apr 2022
    1. 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 初始化吗?

    1. std::move can be used whenever we want to treat an l-value like an r-value for the purpose of invoking move semantics instead of copy semantics.

      std::move 在什么情况下可以使用?

  2. Mar 2022