浏览代码

AK: Allow default-constructing DistinctNumeric

This makes it much more useful as a replacement type for integers.
It's zeroed out by default.
Andreas Kling 4 年之前
父节点
当前提交
900865975a
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      AK/DistinctNumeric.h

+ 5 - 1
AK/DistinctNumeric.h

@@ -70,6 +70,10 @@ class DistinctNumeric {
     using Self = DistinctNumeric<T, X, Incr, Cmp, Bool, Flags, Shift, Arith>;
 
 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