Commit 03f0917a authored by Chad Austin's avatar Chad Austin Committed by Facebook Github Bot

Disallow Optional::operator=(nullptr_t) unless T is a pointer

Summary: The old implementation of folly::none inadvertently allowed disengaging an optional by writing `op = nullptr`. Disallow that and require `op = folly::none`.

Reviewed By: yfeldblum

Differential Revision: D12884724

fbshipit-source-id: b17bcf00b245069d8ea2d9bc3703b0fdcaa85c07
parent 192033c9
...@@ -227,18 +227,6 @@ class Optional { ...@@ -227,18 +227,6 @@ class Optional {
return *this; return *this;
} }
/**
* DEPRECATED: use folly::none
*/
template <typename Null = std::nullptr_t>
Optional& operator=(typename std::enable_if<
!std::is_pointer<Value>::value &&
std::is_same<Null, std::nullptr_t>::value,
Null>::type) noexcept {
reset();
return *this;
}
template <class... Args> template <class... Args>
Value& emplace(Args&&... args) { Value& emplace(Args&&... args) {
clear(); clear();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment