Home > Back-end >  Want to realize the toString method in each base class C, convenient log print each member variable
Want to realize the toString method in each base class C, convenient log print each member variable

Time:09-21

Want to achieve in the c + + base classes each toString method, convenient log print each member variable values, but his hand writing class member variables too much too much too difficult, I want to a way of thinking is to use the script to automatically generate the toString method, is the class files, use the script to read in, and then identify each class, find a member variable, in the script then write the toString method, write back to the class file, main is to identify classes and member variables, and difficult to deal with custom types, the great god have similar implementation approach or a similar project reference, even the variables Set with the get method to achieve the best

CodePudding user response:


Similar to Java reflection technology, or development of its own code analyzer, I also have thought before,

CodePudding user response:

Under his roof, each great god who has a good solution to the

CodePudding user response:

reference 1st floor smwhotjay response:

Similar Java reflection technology, or development of its own code analyzer, I also have thought, before the
before as if he had been seen someone with batch processing to make the kind of serialization, deserialization, generating serialization code directly, but no source study

CodePudding user response:

Someone have a method

CodePudding user response:

I've always been a manual, I also want to know, the landlord to find the way to the top on me
  • Related