[ADT] Use default member initialization in OptionalStorage (NFC)

This commit is contained in:
Kazu Hirata 2022-02-05 16:29:24 -08:00
parent e24384b506
commit f072603685

View File

@ -62,12 +62,12 @@ class OptionalStorage {
char empty;
T value;
};
bool hasVal;
bool hasVal = false;
public:
~OptionalStorage() { reset(); }
constexpr OptionalStorage() noexcept : empty(), hasVal(false) {}
constexpr OptionalStorage() noexcept : empty() {}
constexpr OptionalStorage(OptionalStorage const &other) : OptionalStorage() {
if (other.hasValue()) {