Topic: More on MSVC's failure to throw std::bad_alloc


Author: "Richard Browne" <richb@pobox.com.au>
Date: 1999/08/25
Raw View
A recent thread discussed the failure of MSVC's default operator new to
throw std::bad_alloc if a memory allocation fails. Out of curiosity, I just
had a look through the MSVC++ library source code. It seems that the
library's std:allocator object does not check for a NULL return from
operator new. This means that any MSVC program that uses STL, string,
i/ostreams etc will *crash* if a memory allocation fails.

Yikes. This moves it out of the realm of non-conformance and into the bug
category.



[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]