Boost logo

Boost :

From: Noel Yap (Noel.Yap_at_[hidden])
Date: 2003-04-25 08:50:11


David Abrahams wrote:
> > int foo(int &param);
> >
> > with
> >
> > int foo(in_out_param<int> param);
> >
> > provided that the in_out_param had no space/time overhead.
>
> Probably not, but I am so uncomfortable with out parameters that I
> basically always avoid them unless their usage is completely idiomatic
> (e.g. in some operators like stream insertion << and the obvious
> assignment variants =, +=, ...). Normally I'll go way out of my way
> to avoid it.

Same here; other than idiomatic uses, like I said before, the only other usage I can see is for objects that can't be copied either for technical reasons (eg no copy constructor or assignment operator) or for practical reasons (eg slow copy constructor or
assignment operator).

Noel

-- 
NOTICE: If received in error, please destroy and notify sender.  Sender does not waive confidentiality or privilege, and use is prohibited.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk