Skip to content

Instantly share code, notes, and snippets.

@ciniml
Last active October 2, 2015 14:42
Show Gist options
  • Save ciniml/b47d6df708a9438613a7 to your computer and use it in GitHub Desktop.
Save ciniml/b47d6df708a9438613a7 to your computer and use it in GitHub Desktop.
enum in struct
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