#ifndef BOOST_COMPAT_TO_UNDERLYING_HPP_INCLUDED #define BOOST_COMPAT_TO_UNDERLYING_HPP_INCLUDED // Copyright 2025 Braden Ganetsky // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #include namespace boost { namespace compat { template constexpr typename std::underlying_type::type to_underlying(E e) noexcept { return static_cast::type>(e); } } // namespace compat } // namespace boost #endif // BOOST_COMPAT_TO_UNDERLYING_HPP_INCLUDED