array ptr in const op root

This commit is contained in:
Christian Zimmermann 2018-09-16 15:53:56 +02:00
parent 98635027de
commit 9c5c361fde

View file

@ -173,7 +173,7 @@ namespace MultiArrayTools
const T* mDataPtr; const T* mDataPtr;
mutable IndexType mIndex; mutable IndexType mIndex;
mutable size_t mOff = 0; mutable size_t mOff = 0;
//std::shared_ptr<MultiArrayBase<T,Ranges...> > mMaPtr; std::shared_ptr<MultiArrayBase<T,Ranges...> > mMaPtr; // never remove this ptr, otherwise we lose temporary container instances!
}; };
template <typename T, class Op> template <typename T, class Op>
@ -663,8 +663,8 @@ namespace MultiArrayTools
ConstOperationRoot(std::shared_ptr<MultiArrayBase<T,Ranges...> > maptr, ConstOperationRoot(std::shared_ptr<MultiArrayBase<T,Ranges...> > maptr,
const std::shared_ptr<typename Ranges::IndexType>&... indices) : const std::shared_ptr<typename Ranges::IndexType>&... indices) :
mDataPtr(maptr->data()), mDataPtr(maptr->data()),
mIndex(maptr->begin()) mIndex(maptr->begin()),
//mMaPtr(maptr) mMaPtr(maptr)
{ {
mIndex(indices...); mIndex(indices...);
} }