`reset()` marked as deprecated
Closed this issue · 4 comments
It should be a mistake that rest()
of boost::optional
is marked as deprecated because std::optional
has reset()
[optional.mod].
The story behind this finding
I am working on adding std::optional
support for Spirit and it requires rewriting of optional handling. Currently it resets optional with boost::none
and I wanted to generalize this (as I do not see a reason why it should handle boost and std optional differently) because I cannot reset std::optional
with boost::none_t
. The reset()
method serves perfectly for this purpose, but the problem is that for some reason boost::optional
has reset()
marked as deprecated.
Yes, I sympathize with the need. I cannot merge your PR as-is. Since deprecation a maintenance thereof has also been abandoned. It needs unit-testing, marking as noexcept
, support in optional<T&>
.
It needs unit-testing
optional/test/optional_test.cpp
Lines 148 to 160 in 106f9ae
optional/test/optional_test.cpp
Lines 674 to 699 in 106f9ae
marking as
noexcept
optional/include/boost/optional/optional.hpp
Line 383 in 106f9ae
support in
optional<T&>
Right. Sorry for too shallow an investigation on my side. I merged the PR with some minor modifications in the documentation.
Thanks!