Last active
October 2, 2015 14:42
-
-
Save ciniml/b47d6df708a9438613a7 to your computer and use it in GitHub Desktop.
enum in struct
This file contains hidden or 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
struct enum_type | |
{ | |
enum type | |
{ | |
one, | |
two, | |
three, | |
}; | |
}; | |
void do_something(enum_type::type enum_value) | |
{ | |
switch(enum_value) | |
{ | |
case enum_type::one: | |
// ONE | |
break; | |
case enum_type::two: | |
// TWO | |
break; | |
case enum_type::three: | |
// THREE | |
break; | |
default: | |
break; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment