diff --git a/src/Functions/if.cpp b/src/Functions/if.cpp index 6c5d84c6098..49e0f7320ff 100644 --- a/src/Functions/if.cpp +++ b/src/Functions/if.cpp @@ -48,11 +48,11 @@ using namespace GatherUtils; */ template -struct is_native_int_or_decimal // NOLINT(readability-identifier-naming) -{ - static constexpr bool value = std::is_integral_v || (is_decimal && sizeof(ResultType) <= 8); -}; +concept is_native_int_or_decimal_v + = std::is_integral_v || (is_decimal && sizeof(ResultType) <= 8); +// This macro performs a branch-free conditional assignment for floating point types. +// It uses bitwise operations to avoid branching, which can be beneficial for performance. #define BRANCHFREE_IF_FLOAT(TYPE, vc, va, vb, vr) \ using UIntType = typename NumberTraits::Construct::Type; \ using IntType = typename NumberTraits::Construct::Type; \ @@ -62,9 +62,6 @@ struct is_native_int_or_decimal // NOLINT(readability-identifier-naming) auto tmp = (~mask & (*reinterpret_cast(&new_a))) | (mask & (*reinterpret_cast(&new_b))); \ (vr) = *(reinterpret_cast(&tmp)); -template -inline constexpr bool is_native_int_or_decimal_v = is_native_int_or_decimal::value; - template inline void fillVectorVector(const ArrayCond & cond, const ArrayA & a, const ArrayB & b, ArrayResult & res) {