Re: why Obj-C
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.