What is the best practice if I want to forward a variable to be moved in C++?

前端 未结 0 938
盖世英雄少女心
盖世英雄少女心 2021-02-04 13:09
#include 
class SomeObject {
// ...Object Definition
};

void B(SomeObject& so)
{
    SomeObject movedTo = std::move(so);
}

void A(SomeObject& so         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题