diff --git a/src/Math/Dual.h b/src/Math/Dual.h index 5e3b6f884..45cc4f344 100644 --- a/src/Math/Dual.h +++ b/src/Math/Dual.h @@ -155,6 +155,33 @@ template class Dual { T _real, _dual; }; +#ifndef DOXYGEN_GENERATING_OUTPUT +#define MAGNUM_DUAL_SUBCLASS_IMPLEMENTATION(Type, Underlying) \ + inline Type operator-() const { \ + return Dual>::operator-(); \ + } \ + inline Type& operator+=(const Dual>& other) { \ + Dual>::operator+=(other); \ + return *this; \ + } \ + inline Type operator+(const Dual>& other) const { \ + return Dual>::operator+(other); \ + } \ + inline Type& operator-=(const Dual>& other) { \ + Dual>::operator-=(other); \ + return *this; \ + } \ + inline Type operator-(const Dual>& other) const { \ + return Dual>::operator-(other); \ + } \ + inline Type operator*(const Dual>& other) const { \ + return Dual>::operator*(other); \ + } \ + template inline Type operator/(const Dual& other) const { \ + return Dual>::operator/(other); \ + } +#endif + /** @debugoperator{Magnum::Math::Dual} */ template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Dual& value) { debug << "Dual(";