TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: FRANK ADAM
from: MATHIEU BOUCHARD
date: 1997-08-28 06:14:00
subject: ctors

CR>> Not necessarily although it does pose some problems with error 
CR>> handling (which you could do with exceptions). Your options are to 
 FA> I've been thinking about this for a while, is there a technical reason
 FA> why constructors are not able to return a value ?
because they either already return `this' through a `new' statement,
either they return `*this' through a non-dynamic use, or either is part
of a non-expression.
1.      Chose * blah = new Chose(1,2,3);
2.      Chose blah = Chose (1,2,3);
3.      Chose blah(1,2,3);
these are the 3 allowed things, and since they only differ by their
returns, that stuff is handled secretly by the compiler and it's not
even called overloading.
matju
--- Terminate 4.00/Pro
---------------
* Origin: The Lost Remains Of SatelliteSoft BBS (1:163/215.42)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.