From 900865975aa5c1f4b65f8eb25d7ea4ee9af3dab1 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 12 Feb 2021 11:58:46 +0100 Subject: [PATCH] AK: Allow default-constructing DistinctNumeric This makes it much more useful as a replacement type for integers. It's zeroed out by default. --- AK/DistinctNumeric.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/AK/DistinctNumeric.h b/AK/DistinctNumeric.h index 7fcf62186b7..59c6ad2739a 100644 --- a/AK/DistinctNumeric.h +++ b/AK/DistinctNumeric.h @@ -70,6 +70,10 @@ class DistinctNumeric { using Self = DistinctNumeric; public: + DistinctNumeric() + { + } + DistinctNumeric(T value) : m_value { value } { @@ -292,7 +296,7 @@ public: } private: - T m_value; + T m_value {}; }; // TODO: When 'consteval' sufficiently-well supported by host compilers, try to