Skip to content

Instantly share code, notes, and snippets.

@dwilliamson
Created June 23, 2014 06:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dwilliamson/b8c93458e62ac0216897 to your computer and use it in GitHub Desktop.
Save dwilliamson/b8c93458e62ac0216897 to your computer and use it in GitHub Desktop.
enum clcpp_attr(reflect) Enums
{
A, B, C, D
};
const clcpp::Type* enum_type = clcpp::GetType<Enums>()->AsEnum();
for (size_t i = 0; i < enum_type->constants.size; i++)
{
const clcpp::EnumConstant& enum_k = enum_type->constants[i];
printf("%s:%d\n", enum_k.name.text, enum_k.value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment