• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: why Obj-C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why Obj-C


  • Subject: Re: why Obj-C
  • From: Jim Correia <email@hidden>
  • Date: Tue, 9 Apr 2002 22:45:00 -0400

On Tuesday, April 9, 2002, at 05:09 PM, Brian Stern wrote:

This is simply not true. Operator new throws an exception on failure. A
constructor for a class written by a good C++ programmer will also throw an
exception if the object cannot be constructed. As a result it is
impossible for a constructor to return a NULL pointer.

Be careful when you use superlatives.

It is true that the current standard says new should throw on failure. This was not always the case.

The actual behavior depends on the "standard" C++ library that you are using.

MSL used to let you control the behavior with preprocessor conditionals (whether new returns NULL on failure, or throws a bad_alloc). Since it ships as source, you can easily make current versions not throw a bad_alloc exception if you have source code which requires that behavior.

Jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: why Obj-C (From: Brian Stern <email@hidden>)

  • Prev by Date: Re: UInt32 and ==
  • Next by Date: Re: How to make mailto: links clickable
  • Previous by thread: Re: why Obj-C
  • Next by thread: Re: why Obj-C
  • Index(es):
    • Date
    • Thread