mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-03-20 03:45:25 +08:00
fix: fix operator precedence in isEven template
Fixes Light-City/CPlusPlusThings#353
This commit is contained in:
@@ -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_ {
|
||||
|
||||
Reference in New Issue
Block a user