From: Justin M. Lewis (boost_at_[hidden])
Date: 2003-04-24 19:11:38
I don't know how you can avoid out params altogether. For non-copyable
objects you're SOL, it's either an out param, or nothing. And, again, the
case of functions returning multiple things. Out params are fairly common,
as I said before, especially in things like COM.
----- Original Message -----
From: "David Abrahams" <dave_at_[hidden]>
To: "Boost mailing list" <boost_at_[hidden]>
Sent: Thursday, April 24, 2003 4:05 PM
Subject: Re: [boost] in/out parameters, coding styles and maintenance [was:
> Augustus Saunders <infinite_8_monkey_at_[hidden]> writes:
> > 1) We normally pay a lot of attention to safety of usage, clarity of
> > intent, confusion from subtle semantics etc in our discussions.
> > Sometimes we might even belabour the point (though I think it's
> > healthy). This question goes to the library writers here. Would you
> > replace:
> > int foo(int ¶m);
> > 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.
> Dave Abrahams
> Boost Consulting
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk