Boost logo

Boost :

Subject: Re: [boost] [optional] Thoughts on disallowing assignment for wrapped references.
From: Mostafa (mostafa_working_away_at_[hidden])
Date: 2011-09-07 23:55:16

> On Wed, 07 Sep 2011 04:01:31 -0700, Stewart, Robert
> <Robert.Stewart_at_[hidden]> wrote:

> Regardless, disallowing assignment for reference types which, in effect,
> "reseats a reference," is surprising in too many cases. A new,
> non-assignable optional type might gain traction, but removing
> assignment from optional<T&> is not acceptable.

To reiterate, I am not advocating such a removal. As for a new,
non-assignable optional type, I'm not yet in a position to broach a
suggestion. I am still educating myself on the alternative approaches
that have been discussed. Part of this education process has been the
discussion in this thread, part has been trawling the archives.
Unfortunately, the latter case is not only laborious, but also it's quite
easy to miss relevant discussions that may not have shown up in search
results. I've come to the conclusion that for such a contentious and much
discussed issue, a matrix of current and alternative behaviours with a
pros/cons section is needed, with any clarifying text added as a
reference. In the next few days I hope to work on such a matrix. Once
completed, the pros/cons can then be evaluated for completeness, and
afterwards any other alternative behaviour that may not have been
explored/discussed can be added to the matrix as needed. In the least,
this will certainly help people who are new to optional, and are
uncomfortable with its current behaviour, and may want to modify it in
which ever way they see fit understand the relevant alternatives and their
pros/cons. To boot, it may help with a design rationale for the
documentation of optional. Once the matrix is complete, let's see if
there are any appealing alternatives.


Boost list run by bdawes at, gregod at, cpdaniel at, john at