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

Why can NRVO (named return value optimization) never apply when returning a by-value function parameter, as in `S byparam(S s){ return s; }`?

struct S { S(); S(const S&); S(S&&); }; S byparam(S s) { return s; }