|
Boost : |
Subject: Re: [boost] [optional] Thoughts on disallowing assignment for wrapped references.
From: Mostafa (mostafa_working_away_at_[hidden])
Date: 2011-10-04 03:44:03
On Tue, 30 Aug 2011 22:23:58 -0700, Mostafa
<mostafa_working_away_at_[hidden]> wrote:
*Bump*
Hi Fernando, may you answer the following query:
As promised, attached is a matrix of alternatives to operator= with
accompanying pros/cons and supplementary reference to explain in detail
what may not be obvious. This matrix and it's examples were culled from
the archives and this thread. Are there any alternatives that were
discussed but which I missed?
Hi Fernando (anybody else that may care to jump in),
In this posting: http://tinyurl.com/6k37wrc, you noted that optional<T&>
can be replaced by optional<reference_wrapper<T> >, and asked why
optional<T&> would still be needed. Gennadiy Rozental responded that it
is still needed for generic programming, else he would have to support a
special case. Can you enlighten me how this is so, so I can add the
rational to the cons section of alt4_optional in the attached doc. (I
would have thought that judicious use of boost::ref/cref would obviate the
need
for any special cases in generic programming.)
Thanks,
Mostafa
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk