The question evaluates understanding of C++ object and value semantics, specifically knowledge of copy versus move behavior, typical heap allocation versus Small String Optimization, and the C++ standard's position on copy-on-write, within the domain of C++ language and performance semantics.
In C++, what happens with std::string when you write: std::string a = "123"; std::string b = a; Describe which operations are invoked (copy construction vs move), typical allocation and Small String Optimization behavior, and why copy-on-write is not required by the standard.