fix self operators (+=, -=)
This commit is contained in:
parent
697aac6b94
commit
54688698c8
1 changed files with 8 additions and 2 deletions
|
@ -219,7 +219,10 @@ namespace MultiArrayTools
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
assert( PackNum<sizeof...(SRanges)-1>::checkIfSameInstance( MAB::mRange->space(), in.mRange->space() ) );
|
assert( PackNum<sizeof...(SRanges)-1>::checkIfSameInstance( MAB::mRange->space(), in.mRange->space() ) );
|
||||||
std::transform(mCont.begin(), mCont.end(), in.mCont.begin(), mCont.begin(), std::plus<T>());
|
for(size_t i = 0; i != size(); ++i){
|
||||||
|
mCont[i] += in.mCont[i];
|
||||||
|
}
|
||||||
|
//std::transform(mCont.begin(), mCont.end(), in.mCont.begin(), mCont.begin(), std::plus<T>());
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -232,7 +235,10 @@ namespace MultiArrayTools
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
assert( PackNum<sizeof...(SRanges)-1>::checkIfSameInstance( MAB::mRange->space(), in.mRange->space() ) );
|
assert( PackNum<sizeof...(SRanges)-1>::checkIfSameInstance( MAB::mRange->space(), in.mRange->space() ) );
|
||||||
std::transform(mCont.begin(), mCont.end(), in.mCont.begin(), mCont.begin(), std::minus<T>());
|
for(size_t i = 0; i != size(); ++i){
|
||||||
|
mCont[i] -= in.mCont[i];
|
||||||
|
}
|
||||||
|
//std::transform(mCont.begin(), mCont.end(), in.mCont.begin(), mCont.begin(), std::minus<T>());
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue