--> Frank Adam wrote to Cliff Rhodes <--
FA>to I've been thinking about this for a while, is there a technical
FA>reason why constructors are not able to return a value ?
Actually they implicitly return a pointer to themselves.
Many times, the compiler calls constructors behind the scenes when
testing some return value would not be practical anyway. For instance,
if you use an object as a function argument, it is copied via the copy
constructor, but there is no way for you to use a return value.
I think, for this reason, and because constructors for built in types
don't return a value, it was decided that ctors shouldn't rely on a
returned value.
Maybe Jerry knows the exact rationale?
Cliff Rhodes
cliff.rhodes@juge.com
crhodes@flash.net
X CMPQwk 1.42 1692 X"Our insignificance is often the cause of our safety." -
Aesop
--- Maximus/2 3.01
---------------
* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)
|