| 106 | struct ShiftLeftChecked { |
| 107 | template <typename T, typename Arg0, typename Arg1> |
| 108 | static enable_if_unsigned_integer_value<T> Call(KernelContext*, Arg0 lhs, Arg1 rhs, |
| 109 | Status* st) { |
| 110 | static_assert(std::is_same<T, Arg0>::value, ""); |
| 111 | if (ARROW_PREDICT_FALSE(rhs < 0 || rhs >= std::numeric_limits<Arg0>::digits)) { |
| 112 | *st = Status::Invalid("shift amount must be >= 0 and less than precision of type"); |
| 113 | return lhs; |
| 114 | } |
| 115 | return lhs << rhs; |
| 116 | } |
| 117 | |
| 118 | template <typename T, typename Arg0, typename Arg1> |
| 119 | static enable_if_signed_integer_value<T> Call(KernelContext*, Arg0 lhs, Arg1 rhs, |