Commit 34c2a169 authored by Kenton Varda's avatar Kenton Varda

Fix old GCC build.

parent 9816a0a4
......@@ -91,14 +91,10 @@ public:
}
template <uint i>
KJ_NORETURN(void allHandled()) {
// After a series of if/else blocks handling each variant of the OneOf, have the final else
// block call allHandled<n>() where n is the number of variants. This will fail to compile
// if new variants are added in the future.
static_assert(i == sizeof...(Variants), "new OneOf variants need to be handled here");
KJ_UNREACHABLE;
}
KJ_NORETURN(void allHandled());
// After a series of if/else blocks handling each variant of the OneOf, have the final else
// block call allHandled<n>() where n is the number of variants. This will fail to compile
// if new variants are added in the future.
private:
uint tag;
......@@ -169,6 +165,17 @@ private:
}
};
template <typename... Variants>
template <uint i>
void OneOf<Variants...>::allHandled() {
// After a series of if/else blocks handling each variant of the OneOf, have the final else
// block call allHandled<n>() where n is the number of variants. This will fail to compile
// if new variants are added in the future.
static_assert(i == sizeof...(Variants), "new OneOf variants need to be handled here");
KJ_UNREACHABLE;
}
} // namespace kj
#endif // KJ_ONE_OF_H_
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