c++stdstringc++03default-constructornothrow

Is std::string's default constructor no-throw?


Can std::string s; throw under any circumstances? Is this regulated by the standard (interested in C++03, in case there are differences)?


Solution

  • This was changed by WG21/N4002. The first working paper contains it I see is WG21/N4296: // 21.4.2, construct/copy/destroy: basic_string() noexcept : basic_string(Allocator()) { }