mardi 21 septembre 2021

How to Stringify a class declaration and define it?

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 is if this is possible with custom macros, some code would be much apricated.

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;




Aucun commentaire:

Enregistrer un commentaire