| Index: base/optional.h
|
| diff --git a/base/optional.h b/base/optional.h
|
| index b468964ae339fbead38f769dd315ff39a008d054..98cd95857094023fae865137d7b90838a93d986f 100644
|
| --- a/base/optional.h
|
| +++ b/base/optional.h
|
| @@ -163,6 +163,8 @@ class Optional {
|
|
|
| constexpr explicit operator bool() const { return !storage_.is_null_; }
|
|
|
| + constexpr bool has_value() const { return !storage_.is_null_; }
|
| +
|
| // TODO(mlamouri): using 'constexpr' here breaks compiler that assume it was
|
| // meant to be 'constexpr const'.
|
| T& value() & {
|
| @@ -231,6 +233,10 @@ class Optional {
|
| swap(**this, *other);
|
| }
|
|
|
| + void reset() {
|
| + FreeIfNeeded();
|
| + }
|
| +
|
| template <class... Args>
|
| void emplace(Args&&... args) {
|
| FreeIfNeeded();
|
|
|