| 147 | |
| 148 | template <class TSmallInt, class TLargeInt> |
| 149 | inline TSmallInt IntegerCast(TLargeInt largeInt) noexcept { |
| 150 | try { |
| 151 | return SafeIntegerCast<TSmallInt>(largeInt); |
| 152 | } catch (const yexception& exc) { |
| 153 | Y_ABORT("IntegerCast: %s", exc.what()); |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | /* Convert given enum value to its underlying type. This is just a shortcut for |
| 158 | * `static_cast<std::underlying_type_t<EEnum>>(enum_)`. |