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

During `std::vector` reallocation, a type has a move constructor declared `noexcept(false)` and a usable copy constructor. What does the vector do, and why?

struct A { A() = default; A(A&&) noexcept(false) { /* ... */ } A(const A&) { /* ... */ } }; std::vector<A> v; // grows past capacity