Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC++copy elision RVO NRVOSingle-choice MCQ

RVO interacts with `std::move`. Why does adding `std::move` to a return of a local often pessimize rather than help?

std::string make() { std::string s = build(); return std::move(s); // vs. return s; }