copy vs std::move for ints

前端 未结 4 1634
一生所求
一生所求 2020-12-08 14:20
  • What\'s difference between default copy and std::move in that example?
  • After move the object is there any dependence between new and old ones?
4条回答
  •  甜味超标
    2020-12-08 15:07

    What's difference between default copy and std::move in that example?

    There is no difference. Copying something satisfies the requirements of a move, and in the case of built-in types, move is implemented as a copy.

    After move the object is there any dependence between new and old

    No, there are no dependencies. Both variables are independent.

提交回复
热议问题