Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-02-10 09:09:00


Pavel Antokolsky aka Zigmar <zigmar_at_[hidden]> writes:

> 2) Modify parameters, but instead of passing by non-const reference -
> pass them by pointer. When pointer passed it immediately indicates
> that variable might be modified as opposite to non-const reference,
> which is a rare beast nowadays. If you think of foo(someVar) via
> foo(&someVar), the second hints about possibility of modifying
> someVar, while first one doesn't.

One problem with that is that by convention, pointer arguments can be
null, whereas the language says there are no legally-formed null
references.

That said, I agree that "out" parameters should be used sparingly at
best.

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