To enable move semantics on a std::vector
do I need to pass by value; so the compiler will not copy the element but just move them?
Example:
class data
{
public:
void setMyData(vector<string> sourceData)
{
private_data_ = sourceData;
}
private:
vector<string> private_data_;
};
Aucun commentaire:
Enregistrer un commentaire