| 1187 | // Returns underlying value from enum value. |
| 1188 | template <typename E> |
| 1189 | [[nodiscard]] constexpr auto enum_underlying(E value) noexcept -> detail::enable_if_t<E, underlying_type_t<E>> { |
| 1190 | return static_cast<underlying_type_t<E>>(value); |
| 1191 | } |
| 1192 | |
| 1193 | // Obtains index in enum values from enum value. |
| 1194 | // Returns optional with index. |