[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:       Uwe Thiem <uwe () uwix ! alt ! na>
Date:       1999-06-10 23:31:07
[Download RAW message or body]

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.

Uwe

-------------------------------------------------------------------------
Uwe Thiem                                        Tel: +264 - 061 - 244511
P.O.Box 30955                                    Fax: +264 - 061 - 244511
Windhoek                                         Email:   uwe@uwix.alt.na
Republic of Namibia                                           uwe@kde.org
                                                       http://www.kde.org
                  **********************************
         You can still escape from the GATES of hell: Use KDE!
-------------------------------------------------------------------------

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

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