c++ - When is std::move redundant? -


simply put have class in i'd move wrapped object.

std::string m_s; string_t(string_t&& s)   : m_s(s.m_s) { } 

i omitted surrounding class structure, added member m_s completeness sake.

am required wrap member access std::move or work since s passed rvalue reference?

you need move here. s.m_s lvalue expression, not bind _rvalue_ reference.

even s lvalue expression, you'd need move if wanted use move-construct variable.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -