• 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: Thomas Lachand-Robert <email@hidden>
  • Date: Wed, 10 Apr 2002 08:17:14 +0200

Le mardi 9 avril 2002, ` 11:09 , Brian Stern a icrit :

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.



I was not talking of constructors but of ordinary functions (considered as messages for the case of interest). Constructors in C++ does not return pointers, but C++ objects. So in particular they cannot return a null pointer. Actually C++ does not "return" anything, which is IMHO a big defect by comparison to the "init" methods in Obj-C where you can change the "constructed" object.

In my example, there was no constructor at all.


Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.
_______________________________________________
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: Can I do something when double click on a button?
  • Previous by thread: Re: why Obj-C
  • Next by thread: Re: why Obj-C
  • Index(es):
    • Date
    • Thread