Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-17 08:39:22

0001 #ifndef BOOST_COMPAT_TO_UNDERLYING_HPP_INCLUDED
0002 #define BOOST_COMPAT_TO_UNDERLYING_HPP_INCLUDED
0003 
0004 // Copyright 2025 Braden Ganetsky
0005 // Distributed under the Boost Software License, Version 1.0.
0006 // https://www.boost.org/LICENSE_1_0.txt
0007 
0008 #include <type_traits>
0009 
0010 namespace boost {
0011 namespace compat {
0012 
0013 template <class E>
0014 constexpr typename std::underlying_type<E>::type to_underlying(E e) noexcept
0015 {
0016     return static_cast<typename std::underlying_type<E>::type>(e);
0017 }
0018 
0019 }  // namespace compat
0020 }  // namespace boost
0021 
0022 #endif  // BOOST_COMPAT_TO_UNDERLYING_HPP_INCLUDED