1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00

add compat shim for std::to_underlying

This commit is contained in:
jeff 2023-03-24 00:21:08 -04:00
parent 10eddfb177
commit 170ecd7add

17
llarp/util/underlying.hpp Normal file
View file

@ -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