Boost logo

Boost :

Subject: [boost] [generic programming] header file for general "default" operations for C++ classes
From: Walt Karas (wkaras_at_[hidden])
Date: 2016-05-04 07:32:43


In C++, a default assignment operator is generated for a class if all of its components (data members and base classes) have an assignment operator.  There are plans in C++17 to do something similar for comparison operators.  This header, in https://github.com/wkaras/C-plus-plus-library-default-operators , facilitates that, more generally, if there is an operation on all the components of a class, a single macro invocation can provide this operation on the class as well.  A big drawback is that it's very intrusive into the class definition.  Each class component must be defined using a macro, COMPOSITE_OP_MBR_T(int) i; for examle.  The class will in truth be a template, with the template parameter being defaulted for normal usage.  I don't know which, if any, existing Boot library this header would belong in.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk