Disallow construction of std::optional from folly::none
Summary:
I spent a day trying to convert some code from folly::Optional to
std::optional. One hour of that was making the necessary syntax
changes. The rest was diagnosing why certain bits of code broke. The
reason turned out to be that `folly::Optional` allowed construction
from nullptr and that `std::optional<bool>{folly::none}` would result
in `std::make_optional(false)`, not `std::nullopt`.
Instead of implementing folly::none with a pointer-to-member, copy the
implementation of the upcoming std::nullopt.
As teams switch to C++17, this should smooth the migration.
Reviewed By: yfeldblum
Differential Revision: D10475780
fbshipit-source-id: 3a072b5e7e95209721d871361f5a24e3e30472cd
Showing
Please register or sign in to comment