| 250 | /// Signed left shift with well-defined behaviour on negative numbers or overflow |
| 251 | template <typename SignedInt, typename Shift> |
| 252 | SignedInt SafeLeftShift(SignedInt u, Shift shift) { |
| 253 | using UnsignedInt = typename std::make_unsigned<SignedInt>::type; |
| 254 | return static_cast<SignedInt>(static_cast<UnsignedInt>(u) << shift); |
| 255 | } |
| 256 | |
| 257 | } // namespace internal |
| 258 | } // namespace arrow |
no outgoing calls