| 230 | /// Signed left shift with well-defined behaviour on negative numbers or overflow |
| 231 | template <typename SignedInt, typename Shift> |
| 232 | SignedInt SafeLeftShift(SignedInt u, Shift shift) { |
| 233 | using UnsignedInt = typename std::make_unsigned<SignedInt>::type; |
| 234 | return static_cast<SignedInt>(static_cast<UnsignedInt>(u) << shift); |
| 235 | } |
| 236 | |
| 237 | } // namespace internal |
| 238 | } // namespace arrow |
no outgoing calls