How to use boost preprocessor to generate accessors?
问题 For example class A { int m_x; float m_y; double m_z; int x() const {return m_x;} float y() const {return m_y;} double z() const {return m_z;} }; becomes like class A { MY_MACRO((int)(float)(double), (x)(y)(z)); }; Please use boost prerocessor sequence to do it because this macro will combine with other existing macros which already use boost preprocesor sequence. 回答1: Disclaimer:You should probably wait in case a better answer appears even if you are satisfied with this answer, because I'm