From 228fef1b3ac3f635b5d7b7546a1c8bd0dd4c57be Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 24 Jan 2017 10:53:51 +0100 Subject: [PATCH] Extended the set of arithmetic operators supported by FixedInt (-,+,*,/,%,&,|) --- Eigen/src/Core/util/IntegralConstant.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Eigen/src/Core/util/IntegralConstant.h b/Eigen/src/Core/util/IntegralConstant.h index b25601ed3..f7baf1060 100644 --- a/Eigen/src/Core/util/IntegralConstant.h +++ b/Eigen/src/Core/util/IntegralConstant.h @@ -26,7 +26,7 @@ template class VariableAndFixedInt; * It is similar to c++11 std::integral_constant but with some additional features * such as: * - implicit conversion to int - * - arithmetic operators: -, +, * + * - arithmetic and some bitwise operators: -, +, *, /, %, &, | * - c++98/14 compatibility with fix and fix() syntax to define integral constants. * * It is strongly discouraged to directly deal with this class FixedInt. Instances are expcected to @@ -64,6 +64,16 @@ public: FixedInt operator+( FixedInt) const { return FixedInt(); } template FixedInt operator-( FixedInt) const { return FixedInt(); } + template + FixedInt operator*( FixedInt) const { return FixedInt(); } + template + FixedInt operator/( FixedInt) const { return FixedInt(); } + template + FixedInt operator%( FixedInt) const { return FixedInt(); } + template + FixedInt operator|( FixedInt) const { return FixedInt(); } + template + FixedInt operator&( FixedInt) const { return FixedInt(); } #if EIGEN_HAS_CXX14 // Needed in C++14 to allow fix():