By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,498 Members | 1,713 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,498 IT Pros & Developers. It's quick & easy.

Re: return type vs passing a reference

P: n/a
On Nov 18, 5:20 pm, ytrem...@nyx.nyx.net (Yannick Tremblay) wrote:
In article
<c35e0ed1-b249-45f8-899e-912aeaa0f...@r36g2000prf.googlegroups.com>,
<mail....@gmail.comwrote:
[...]
3- If there's an exception thrown by getT in:
Type t;
getT(t);
You end up with a default initialised Type object that has no
reason to be.
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:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Nov 18 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.