'How to convert a class declaration to a string using macros?
I need to convert my class declaration into a string and I also need the class defined. in the code below i have given an example which results in Identifier Person is undefined or Incomplete type not allowed. but if this is possible with custom macros, some code would be much appreciated.
struct Person;
std::string Person::meta = STRINGIFY(
struct Person{
static std::string meta;
std::string name = "Test";
int age = 5;
std::string address = "No:35179 Address";
};
);
Person person;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
