سؤال

I'm trying to find a online reference to see the exception safety of several std containers.

In the case of std::vector, Does it keep the state previous to the push_back call? I would presume the vector has all its objects still valid (no destructors invoked). What guarantees offer std::vector after push_back throws a std::bad_alloc exception?

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top