tetl
0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
to_underlying.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSL-1.0
2
3
#ifndef TETL_UTILITY_TO_UNDERLYING_HPP
4
#define TETL_UTILITY_TO_UNDERLYING_HPP
5
6
#include <
etl/_type_traits/underlying_type.hpp
>
7
8
namespace
etl
{
9
13
template
<
typename
Enum>
14
[[nodiscard]]
constexpr
auto
to_underlying
(Enum e)
noexcept
->
underlying_type_t<Enum>
15
{
16
return
static_cast<
underlying_type_t<Enum>
>
(e);
17
}
18
19
}
// namespace etl
20
21
#endif
// TETL_UTILITY_TO_UNDERLYING_HPP
etl::underlying_type_t
typename underlying_type< T >::type underlying_type_t
Definition
underlying_type.hpp:31
etl
Definition
adjacent_find.hpp:8
etl::to_underlying
constexpr auto to_underlying(Enum e) noexcept -> underlying_type_t< Enum >
Converts an enumeration to its underlying type.
Definition
to_underlying.hpp:14
underlying_type.hpp
include
etl
_utility
to_underlying.hpp
Generated on Sat Mar 8 2025 16:19:59 for tetl by
1.14.0