Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC++noexceptSingle-choice MCQ

What is the behavior of this code at the call to `g()`?

#include <vector> struct Widget { Widget(Widget&&) noexcept(false); // throwing move Widget(const Widget&); // copy }; void g() { std::vector<Widget> v; v.reserve(4); // ... fill with elements ... v.push_back(Widget{}); // triggers a later reallocation/grow }