[Insight-developers] is operator new returning NULL ?

Mathieu Malaterre mathieu.malaterre at gmail.com
Tue Dec 11 08:18:45 EST 2007


Hi,

  The other day I was reading through some C code ported to C++ in
Code/IO namely the Siemens/GE4/GE5 stuff and found the following piece
of code:

  GEImageHeader *hdr = new GEImageHeader;
  if(hdr == 0)
    {
    RAISE_EXCEPTION();
    }

  AFAIK operator new never returns NULL, but throw an exception...well
on a standard conforming compiler. so the question is: is the code
simply copy/paste from C code or are there some (VS6 ?) buggy compiler
that do not throw exception ?

thanks,

-- 
Mathieu


More information about the Insight-developers mailing list