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 <vector> | |
#include <string> | |
using std::string; | |
/* | |
These macros define a struct with an implicitly defined Show function that visits each member. | |
The trick is that a typedef is split between each STRUCT_MEMBER instance and the preceding macro, | |
which allows it to define an empty struct type that identifies the following struct member, while also | |
knowing the struct type that the preceding macro is using to identify the current member. |