Skip to content

Instantly share code, notes, and snippets.

@gomons gomons/to_underlying.cpp
Last active Jun 15, 2016

Embed
What would you like to do?
Convert enum class value to undrlying type
template <typename E> constexpr typename std::underlying_type<E>::type to_underlying(E e) {
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
You can’t perform that action at this time.