Files
PlantAI-dev/tools/pymol-open-source/include/pymol/utility.h
T
2026-08-03 18:42:47 +08:00

21 lines
367 B
C++

#pragma once
#include <cstdint>
#include <type_traits>
namespace pymol
{
/**
* C++ 23's std::to_underlying
* @param e The enum to convert
* @return The underlying type of the enum
*/
template <class EnumT>
constexpr std::underlying_type_t<EnumT> to_underlying(EnumT e) noexcept
{
return static_cast<std::underlying_type_t<EnumT>>(e);
}
} // namespace pymol