On Nov 18, 5:20 pm, ytrem...@nyx.ny x.net (Yannick Tremblay) wrote:
[...]
Just a nit, but that's only true if you open a try block which
catches the exception between the definition and the function
call. Hvaing to declare the variable separately is awkward; it
can be very awkward in more complicated expressions, but it's
not quite as dangerous as you suggest.
--
James Kanze (GABI Software) email:james.kan ze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
In article
<c35e0ed1-b249-45f8-899e-912aeaa0f...@r3 6g2000prf.googl egroups.com>,
<mail....@gmail .comwrote:
<c35e0ed1-b249-45f8-899e-912aeaa0f...@r3 6g2000prf.googl egroups.com>,
<mail....@gmail .comwrote:
3- If there's an exception thrown by getT in:
Type t;
getT(t);
Type t;
getT(t);
You end up with a default initialised Type object that has no
reason to be.
reason to be.
catches the exception between the definition and the function
call. Hvaing to declare the variable separately is awkward; it
can be very awkward in more complicated expressions, but it's
not quite as dangerous as you suggest.
--
James Kanze (GABI Software) email:james.kan ze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34