Created
March 15, 2017 23:23
-
-
Save Klowner/a3d496f9000246823810f7fba465de79 to your computer and use it in GitHub Desktop.
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
#include <iostream> | |
#include <string> | |
#include <vector> | |
#define DEF(_name_) _name_, | |
typedef enum { | |
#include "types_defs.h" | |
MAX_TYPES, | |
} Types; | |
#undef DEF | |
#define DEF(_name_) #_name_, | |
std::vector<std::string> typeNames = { | |
#include "types_defs.h" | |
}; | |
#undef DEF | |
int main() { | |
for (int i=0; i<MAX_TYPES; ++i) | |
{ | |
std::cout << i << ' ' << typeNames[i] << '\n'; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment