|
|
|
|
|
by tsimionescu
912 days ago
|
|
Well, what do you expect std::vector<T>::at() to do if the index is out of bounds and it can't throw exceptions? Or std::vector<T>::push_back() if it can't reallocate to a larger size? These are just some obvious cases. Not to mention that any use of operator new is UB if memory allocation fails and the system can't throw exceptions. |
|
That's probably not great and might leave data in a bad shape, but it seems better than "undefined behavior" aka no guarantees whatsoever, no?