|
Boost : |
From: Rob Stewart (stewart_at_[hidden])
Date: 2005-07-22 08:35:34
From: David Abrahams <dave_at_[hidden]>
> David Abrahams <dave_at_[hidden]> writes:
>
> > and the example taking a non-const reference is confusing. I'll
> > shuffle things around.
>
> Done.
Much better.
On the other hand\x{2014}as you may recall from the parameter
table\x{2014}``color_map`` is an \x{201C}out\x{201D}
parameter, so it really should be passed by non-const
reference.
Note that "color_map" and "out" are quoted significantly
differently with no apparent reason.
A keyword object has a pair of operator= overloads that ensure
we can pass anything by name, but when an \x{201C}out\x{201D}
parameter is passed positionally, that's no help: in this
case, core::depth_first_search would end up with a const
reference to the color_map and compilation will fail when
mutating operations are used on it.
That's a long sentence and did you really mean to say "we can
pass *anything*" (emphasis mine)?
Perhaps this would be better:
A keyword object has a pair of operator = overloads that
ensure we can pass references to const or non-const objects by
name, but when an "out" parameter is passed positionally,
that's no help. In that case, core:;depth_first_search would
end up with a...."
-- Rob Stewart stewart_at_[hidden] Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk