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

This function returns a local by value. Under C++17 rules, what is the correct account of which elision applies and whether a move can occur?

std::vector<int> make(bool b) { std::vector<int> v{1, 2, 3}; std::vector<int> w{4, 5, 6}; if (b) return v; return w; }