summaryrefslogtreecommitdiff
path: root/AK/Optional.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-03-06 10:26:05 +0100
committerAndreas Kling <kling@serenityos.org>2020-03-06 10:32:58 +0100
commit8bb361889c3c37dbaa0254bb9a76dcd94aeab115 (patch)
tree28c937882baff5050424733d729e57cc4d238b4b /AK/Optional.h
parentae233c1e82afd7a85741c3f7ea986f9b64dd69bd (diff)
downloadserenity-8bb361889c3c37dbaa0254bb9a76dcd94aeab115.zip
AK: Remove Optional::operator bool()
This was causing some obvious-in-hindsight but hard to spot bugs where we'd implicitly convert the bool to an integer type and carry on with the number 1 instead of the actual value().
Diffstat (limited to 'AK/Optional.h')
-rw-r--r--AK/Optional.h3
1 files changed, 0 insertions, 3 deletions
diff --git a/AK/Optional.h b/AK/Optional.h
index 80986dca78..c135440013 100644
--- a/AK/Optional.h
+++ b/AK/Optional.h
@@ -150,9 +150,6 @@ public:
return fallback;
}
- SET_TYPESTATE(consumed)
- operator bool() const { return m_has_value; }
-
private:
// Call when we don't want to alter the consume state
const T& value_without_consume_state() const