On Sun, 16 Nov 2014 23:04:43 -0800, Andrzej Krzemienski
Hi Everyone, I would like to run an idea through everyone in this list. There is a recurring complaint about Boost.Optional that it allows you to do "unsafe" things: 1. Inadvertent mixed comparisons between T and optional<T> 2. Unintended conversion from T to optional<T>
The problem with optional is that it tries to be a drop-in replacement
proxy for its underlying type, and, unfortunately, it can't fully do that.
So it ends up with an identity crisis. IMO, optional should be treated as
a first class object, not a thin wrapper around T, that means no implicit
conversions to/from T, no implicit comparisons with T, etc... Last time I
looked at this, that will solve the reference rebinding gotcha. That is,
you'll have one behavior for optional<T> and optional