---
title: llarp/util/underlying.hpp

---

# llarp/util/underlying.hpp



## Namespaces

| Name           |
| -------------- |
| **[llarp](Namespaces/namespacellarp.md)** <br>[crypto.hpp] |




## Source code

```cpp
#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
```


-------------------------------

Updated on 2023-04-27 at 04:17:18 +0000
