OGS
cpp23.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <type_traits>
7
8// ToDo (tm) remove with c++23
9
10namespace BaseLib
11{
21template <typename E>
22constexpr auto to_underlying(E e) noexcept
23{
24 return static_cast<std::underlying_type_t<E>>(e);
25}
26} // namespace BaseLib
constexpr auto to_underlying(E e) noexcept
Converts an enumeration to its underlying type.
Definition cpp23.h:22