Commit c534e8b6 authored by Kenton Varda's avatar Kenton Varda

Don't allow kj::maxValue / kj::minValue for Guarded types, since they'll break…

Don't allow kj::maxValue / kj::minValue for Guarded types, since they'll break down when CAPNP_DEBUG_TYPES is off.
parent 8b0489d8
......@@ -514,10 +514,6 @@ class GuardedConst {
public:
GuardedConst() = default;
inline constexpr GuardedConst(decltype(kj::maxValue)) {}
inline constexpr GuardedConst(decltype(kj::minValue)) {}
// These aren't directly useful but cause kj::max()/kj::min() to choose types correctly.
inline constexpr uint unwrap() const { return value; }
#define OP(op, check) \
......@@ -608,8 +604,6 @@ public:
static_assert(maxN <= T(kj::maxValue), "possible overflow detected");
Guarded() = default;
inline constexpr Guarded(decltype(kj::maxValue)): value(maxN) {}
inline constexpr Guarded(decltype(kj::minValue)): value(0) {}
Guarded(const Guarded& other) = default;
template <typename OtherInt, typename = EnableIf<isIntegral<OtherInt>()>>
......
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