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

For T f() { T a, b; if (cond) return a; else return b; }, why can NRVO legally fail here even with optimizations on, and what does the standard then require?

T f() { T a, b; if (cond) return a; else return b; }