Hi Everyone,
This might have been too hasty, but I have put a new version of
Boost.Optional on branch master. Tests in 'develop' and 'master' branches
pass fine, but I am not sure what it says about overall stability of the
library.
The changes include:
- Move semantics, interoperable with std::move_if_noexcept() -- i.e.,
move operations are conditionally noexcept;
- Using explicit operator bool() rather than custom 'safe-bool idiom'
--on applicable platforms; this will break code that exploited the security
hole in safe-bool idiom.
- Now, you cannot bind optional to a temporary (the
constructor and assignment taking T&& is deleted);this also break some
usages that are likely buggy, but there is a macro to put it back.
- Comparison with boost::none does not require that T be
EqualityComparable: we just forward the call to operator bool() od
operator!().
- optional is explicitly prohibited.
- some operations are marked noexcept (on platforms that support the
keyword).
- Rewritten some portions of documentation.
I encourage everyone with spare time and available resources to test the
version and give us feedback. Please remember that this is supposed to be
an incremental improvement over the previous version (for Boost 1.56.0),
and next upgrades are planned in the future.
Regards,
&rzej