Skip to content

Instantly share code, notes, and snippets.

@dirocco
Created October 9, 2020 20:33
Show Gist options
  • Save dirocco/0e23867d0ea9ab2a23dd6dcaba065f53 to your computer and use it in GitHub Desktop.
Save dirocco/0e23867d0ea9ab2a23dd6dcaba065f53 to your computer and use it in GitHub Desktop.
template<typename E>
constexpr typename std::underlying_type<E>::type toBase(E e) noexcept
{
return static_cast<typename std::underlying_type<E>::type>(e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment