Disallow constructing folly::Optional with nullptr
Summary: Disallow initializing folly::Optional with nullptr as if it were folly::none. The previous behavior was a footgun when transitioning to C++17's std::optional. For example, given: ``` folly::Optional<bool> o1 = nullptr; std::optional<bool> o2 = nullptr; ``` o1 would be none, but o2 would have the value `{false}`. This diff makes the former illegal, preventing behavior changes when transitioning to std::optional. Reviewed By: yfeldblum Differential Revision: D12843022 fbshipit-source-id: 165d19a963672c04d9ec687cb687ca89f1837e21
Showing
Please register or sign in to comment