To support move semantics, should function parameters be taken by unique_ptr, by value, or by rvalue?
问题 One of my function takes a vector as a parameter and stores it as a member variable. I am using const reference to a vector as described below. class Test { public: void someFunction(const std::vector<string>& items) { m_items = items; } private: std::vector<string> m_items; }; However, sometimes items contains a large number of strings, so I'd like to add a function (or replace the function with a new one) that supports move semantics. I am thinking of several approaches, but I'm not sure