AK: Allow default-constructing DistinctNumeric

This makes it much more useful as a replacement type for integers.
It's zeroed out by default.
This commit is contained in:
Andreas Kling 2021-02-12 11:58:46 +01:00
parent e44c1792a7
commit 900865975a
Notes: sideshowbarker 2024-07-18 22:24:38 +09:00

View file

@ -70,6 +70,10 @@ class DistinctNumeric {
using Self = DistinctNumeric<T, X, Incr, Cmp, Bool, Flags, Shift, Arith>; using Self = DistinctNumeric<T, X, Incr, Cmp, Bool, Flags, Shift, Arith>;
public: public:
DistinctNumeric()
{
}
DistinctNumeric(T value) DistinctNumeric(T value)
: m_value { value } : m_value { value }
{ {
@ -292,7 +296,7 @@ public:
} }
private: private:
T m_value; T m_value {};
}; };
// TODO: When 'consteval' sufficiently-well supported by host compilers, try to // TODO: When 'consteval' sufficiently-well supported by host compilers, try to