On Feb 16, 3:53 pm, yeti
> On Feb 16, 3:21 am, Andre Kostur
> > 4c37d8fe4...@d4g2000prg.googlegroups.com:
> > > 2. Why can't constructor and destructor return values ??
> > Return values to where? What's your use-case for having
> > these return values?
> If constructors could return values they could possibly return error
> codes if object construction failed.
A constructor establishes the class invariants. If it fails,
the class invariants can't be established. Which means that the
instance of the class shouldn't exist.
In sum, what we get with exceptions.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34