Commit 1c71c828 authored by Kenton Varda's avatar Kenton Varda Committed by Kenton Varda

Implement equality comparison to minValue / maxValue.

parent 98ade8b6
......@@ -592,6 +592,11 @@ static KJ_CONSTEXPR(const) MinValue_ minValue = MinValue_();
//
// `char` is not supported, but `signed char` and `unsigned char` are.
template <typename T>
inline bool operator==(T t, MaxValue_) { return t == Decay<T>(maxValue); }
template <typename T>
inline bool operator==(T t, MinValue_) { return t == Decay<T>(minValue); }
template <uint bits>
inline constexpr unsigned long long maxValueForBits() {
// Get the maximum integer representable in the given number of bits.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment