Mail Archives: djgpp/1997/06/10/16:10:09
Hello, I am wondering how to make the operator "new" return NULL instead of
throwing an exception when trying to allocate more memory than available.
The following was cut from the C++ draft:
T* p1 = new T; // throws bad_alloc if it fails
T* p2 = new(nothrow) T; // returns 0 if it fails
But the second example fails, saying that nothrow was undeclared. Is this a
bug in DJGPP or is there some special headerfile that has to be included?
------- Peter Palotas alias Blizzar -- blizzar AT hem1 DOT passagen DOT se ---------
*********************************************************************
* A brief description of DJGPP: *
* Never before has so few people done so much for so many... DJGPP! *
*********************************************************************
- Raw text -