Last active
June 15, 2016 08:02
-
-
Save gomons/f7c9eecbb26b48374166a3b5858e2d72 to your computer and use it in GitHub Desktop.
Convert enum class value to undrlying type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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