Given this example:
#include <string> class Foo { public: Foo(std::string p_member) : m_member{p_member} {} private: std::string m_member; }; int main() { Foo f{"Test"}; return 0; } In Foo ctor, is the string copied or moved by default? Do I have to explicitly write the std::move(p_member)?
std::movem_member{std::move(p_member)}and half a year later you/someone_else add more logic to the constructor, where you would like to reuse yourp_member, you will run into not so obvious bug.