mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
16 lines
320 B
C
16 lines
320 B
C
|
// SPDX-License-Identifier: CC0-1.0
|
||
|
|
||
|
#pragma once
|
||
|
|
||
|
#include <type_traits>
|
||
|
|
||
|
namespace Common
|
||
|
{
|
||
|
// TODO: Replace with std::to_underlying in C++23
|
||
|
template <typename Enum>
|
||
|
constexpr std::underlying_type_t<Enum> ToUnderlying(Enum e) noexcept
|
||
|
{
|
||
|
return static_cast<std::underlying_type_t<Enum>>(e);
|
||
|
}
|
||
|
} // namespace Common
|