...
In this noncompliant code example, an exception of type S
is thrown from f()
. However, because S
has a std::string
data member, and the copy constructor for std::string
is not declared noexcept
, the implicitly-defined copy constructor for S
is also not declared to be noexcept
. In low-memory situations, the copy constructor for std::string
may be unable to allocate sufficient memory to complete the copy operation, resulting in a std::bad_alloc
exception being thrown.
...