From 2bbf8a7e44164b916fa6d552a97cfb374f85cd17 Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Mon, 28 Oct 2024 23:05:17 -0700 Subject: [PATCH] op_types: operator-= --- src/include/operation/op_types.cc.h | 16 ++++++++++++++++ src/include/operation/op_types.h | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/src/include/operation/op_types.cc.h b/src/include/operation/op_types.cc.h index 4e246cd..a3f91e4 100644 --- a/src/include/operation/op_types.cc.h +++ b/src/include/operation/op_types.cc.h @@ -237,6 +237,14 @@ namespace CNORXZ return *this; } + template + template + constexpr OpCont& OpCont::operator-=(const Op& o) + { + OI::a(mIndex, [](auto& a1, const auto& a2) { a1 -= a2; }, o); + return *this; + } + template constexpr OpCont& OpCont::operator=(const OpCont& o) { @@ -328,6 +336,14 @@ namespace CNORXZ return *this; } + template + template + constexpr OpRoot& OpRoot::operator-=(const Op& o) + { + OI::a(mIndex, [](auto& a, const auto& b) { a -= b; }, o); + return *this; + } + template constexpr OpRoot& OpRoot::operator=(const OpRoot& o) { diff --git a/src/include/operation/op_types.h b/src/include/operation/op_types.h index d60ce71..bb516bb 100644 --- a/src/include/operation/op_types.h +++ b/src/include/operation/op_types.h @@ -159,6 +159,9 @@ namespace CNORXZ template constexpr OpCont& operator+=(const Op& in); + template + constexpr OpCont& operator-=(const Op& in); + constexpr OpCont& operator=(const OpCont& in); template @@ -196,6 +199,9 @@ namespace CNORXZ template constexpr OpRoot& operator+=(const Op& in); + template + constexpr OpRoot& operator-=(const Op& in); + constexpr OpRoot& operator=(const OpRoot& in); template