C++ equal(==) overload, Shortcut or best way comparing all attributes
There is a not to the operator==related solution possible. You can generate the related code from a definition table with the help of so called X-Macro. The table could look like #define MEMBER_TBL \ /*type ,name ,default*/ \ X(int ,_(i) ,42 ) \ X(float ,_(f) ,3.14 ) \ X(std::string , t ,"Hello") \ The _()stuff is needed to avoid a trailing , on generation the std::tie() call.
https://stackoverflow.com/q/35704543/13040423