delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/10/16:10:09

Date: Tue, 10 Jun 1997 22:09:16 +0200 (MDT)
Message-Id: <3.0.16.19970611033103.3ac7c80e@hem1.passagen.se>
To: djgpp AT delorie DOT com
From: Peter Palotas <blizzar AT hem1 DOT passagen DOT se>
Subject: Bug in DJGPP???
Mime-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019