ariadne-cps / ariadne

C++ framework for rigorous computation on cyber-physical systems
http://www.ariadne-cps.org
GNU General Public License v3.0
28 stars 9 forks source link

Reduce or avoid use of mixins to provide arithmetic operations #719

Open pietercollins opened 1 year ago

pietercollins commented 1 year ago

We currently use mixins to declare common arithmetic and other elementary operations as friends. This has the advantage of ensuring support for common sets of operations and minimising code, but can make it hard to see which operations are supported, and results in many similar sets of operations in arithmetic.hpp and float_operations.hpp. It also causes difficulty with the documentation, since mixed-in operations are not inherited in Doxygen, and issues with GCC-12 (though this may be a compiler bug); see #696.

We should consider reducing the use of mixins for this purpose (e.g. for a few common purposes, like dispatching operators to named operations) or eliminating it entirely.