fix: fix operator precedence in isEven template

Fixes Light-City/CPlusPlusThings#353
This commit is contained in:
light-city
2026-03-12 23:28:17 +08:00
committed by Francis
parent c9d0f14d92
commit e520e4e7e6

View File

@@ -20,7 +20,7 @@ template <typename Then, typename Else> struct IF<false, Then, Else> {
// 判断奇数与偶数
template <int N> struct isEven {
static const auto RES = IF<N & 1 == 0, true_type, false_type>::result::value;
static const auto RES = IF<(N & 1) == 0, true_type, false_type>::result::value;
};
template <int nums1, int nums2> struct Add_ {