0

I saw Nicol Bolas said

never take unique_ptr by &&, unless you are actually writing its move constructor

in his anwser post.

I thought force the explicit calling of std::move on unique_ptr by && should be a good practice, which notice the coder: from here on, the unique_ptr got moved into another place, don't touch it anymore.

So why did Nicol Bolas say that?

Community
  • 1
  • 1
Galaxy
  • 1,129
  • 11
  • 27

0 Answers0