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

Since C++17, in which of these is copy elision GUARANTEED (mandatory), as opposed to merely permitted?

struct W { W(); W(const W&) = delete; }; W make() { return W(); } // (1) W take(W w) { return w; } // (2) W pick(bool b){ W a, c; return b ? a : c; } // (3)