mirror of https://github.com/oxen-io/lokinet
add compat shim for std::to_underlying
parent
10eddfb177
commit
170ecd7add
@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
#include <utility>
|
||||
|
||||
namespace llarp
|
||||
{
|
||||
|
||||
#ifdef __cpp_lib_to_underlying
|
||||
using to_underlying = std::to_underlying;
|
||||
#else
|
||||
template <typename T>
|
||||
constexpr auto
|
||||
to_underlying(T t)
|
||||
{
|
||||
return static_cast<std::underlying_type_t<T>>(t);
|
||||
}
|
||||
#endif
|
||||
} // namespace llarp
|
Loading…
Reference in New Issue