op_types: operator-=

This commit is contained in:
Christian Zimmermann 2024-10-28 23:05:17 -07:00
parent ee3e1b5d4f
commit 2bbf8a7e44
2 changed files with 22 additions and 0 deletions

View file

@ -237,6 +237,14 @@ namespace CNORXZ
return *this; return *this;
} }
template <typename T, class IndexT>
template <class Op>
constexpr OpCont<T,IndexT>& OpCont<T,IndexT>::operator-=(const Op& o)
{
OI::a(mIndex, [](auto& a1, const auto& a2) { a1 -= a2; }, o);
return *this;
}
template <typename T, class IndexT> template <typename T, class IndexT>
constexpr OpCont<T,IndexT>& OpCont<T,IndexT>::operator=(const OpCont<T,IndexT>& o) constexpr OpCont<T,IndexT>& OpCont<T,IndexT>::operator=(const OpCont<T,IndexT>& o)
{ {
@ -328,6 +336,14 @@ namespace CNORXZ
return *this; return *this;
} }
template <typename T, class IndexT>
template <class Op>
constexpr OpRoot<T,IndexT>& OpRoot<T,IndexT>::operator-=(const Op& o)
{
OI::a(mIndex, [](auto& a, const auto& b) { a -= b; }, o);
return *this;
}
template <typename T, class IndexT> template <typename T, class IndexT>
constexpr OpRoot<T,IndexT>& OpRoot<T,IndexT>::operator=(const OpRoot<T,IndexT>& o) constexpr OpRoot<T,IndexT>& OpRoot<T,IndexT>::operator=(const OpRoot<T,IndexT>& o)
{ {

View file

@ -159,6 +159,9 @@ namespace CNORXZ
template <class Op> template <class Op>
constexpr OpCont& operator+=(const Op& in); constexpr OpCont& operator+=(const Op& in);
template <class Op>
constexpr OpCont& operator-=(const Op& in);
constexpr OpCont& operator=(const OpCont& in); constexpr OpCont& operator=(const OpCont& in);
template <class PosT> template <class PosT>
@ -196,6 +199,9 @@ namespace CNORXZ
template <class Op> template <class Op>
constexpr OpRoot& operator+=(const Op& in); constexpr OpRoot& operator+=(const Op& in);
template <class Op>
constexpr OpRoot& operator-=(const Op& in);
constexpr OpRoot& operator=(const OpRoot& in); constexpr OpRoot& operator=(const OpRoot& in);
template <class PosT> template <class PosT>