Is it necessary to define move constructors from different classes?

前端 未结 2 2024
别那么骄傲
别那么骄傲 2021-02-20 05:55

Consider the following:

struct X
{
    Y y_;

    X(const Y & y) :y_(y) {}    
    X(Y && y) :y_(std::move(y)) {}
};

Is it necessar

2条回答
提交回复
热议问题