add compat shim for std::to_underlying

pull/2119/head
jeff 1 year ago
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…
Cancel
Save