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