[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: A note to exceptions && some notes to codesize
From:       Stephan Kulow <coolo () itm ! mu-luebeck ! de>
Date:       1999-06-11 8:36:51
[Download RAW message or body]

Uwe Thiem wrote:
> 
> On Wed, 9 Jun 1999, Johannes Sixt wrote:
> 
> > On Mon, 07 Jun 1999, Mario Weilguni wrote:
> > >Somebody mentioned here that exceptions can be used to report "no-more-memory"
> > >for C++. According to the GNU info for gcc, this is not necessary, since the C++
> > >standard requires that "new" never returns NULL.
> >
> > Have you read the whole story? new never returns NULL because it throws an
> > exception of type bad_alloc if there's not enough memory! So exceptions *ARE*
> > used to report out-of-memory situations and exceptions *MUST* be used to
> > *handle* them!
> 
> Hannes, this means that the whole CHECK_PTR() exercise after a "new"
> is useless?  Grrr.
> 
In C++ yes - not in compilers's implmentation :)

Greetings, Stephan

-- 
As long as Linux remains a religion of freeware fanatics,
Microsoft have nothing to worry about.  
                       By Michael Surkan, PC Week Online

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic