Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-04-24 18:05:24


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 &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.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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