use ptr directly in getStepSize + NO FORWARD in OpExpr in map (corrupted EVERYTHING)

This commit is contained in:
Christian Zimmermann 2019-03-21 01:04:47 +01:00
parent 84355b3118
commit f70efbeb82
2 changed files with 4 additions and 2 deletions

View file

@ -18,7 +18,7 @@ namespace MultiArrayTools
OpExpr<MapF,IndexPack,Expr,STYPE>::OpExpr(const MapF& mapf, const IndexPack& ipack, OpExpr<MapF,IndexPack,Expr,STYPE>::OpExpr(const MapF& mapf, const IndexPack& ipack,
const std::shared_ptr<OIType>& oind, size_t step, Expr ex) : const std::shared_ptr<OIType>& oind, size_t step, Expr ex) :
mIndPtr(oind.get()), mSPos(mIndPtr->pos()), mMax(mIndPtr->max()), mIndPtr(oind.get()), mSPos(mIndPtr->pos()), mMax(mIndPtr->max()),
mStep(step), mExpr( std::forward<Expr>(ex) ), mStep(step), mExpr( ex ),
mOp(mkMapOp(mapf, ipack)), mOp(mkMapOp(mapf, ipack)),
//mExt(ex.rootSteps( reinterpret_cast<std::intptr_t>( mIndPtr ))) //mExt(ex.rootSteps( reinterpret_cast<std::intptr_t>( mIndPtr )))
mExt( mOp.rootSteps( reinterpret_cast<std::intptr_t>( mIndPtr ) ).extend mExt( mOp.rootSteps( reinterpret_cast<std::intptr_t>( mIndPtr ) ).extend

View file

@ -720,7 +720,9 @@ namespace MultiArrayHelper
template <class Index> template <class Index>
static inline size_t getStepSize(const Index& ii, std::intptr_t j) static inline size_t getStepSize(const Index& ii, std::intptr_t j)
{ {
return ii.ptrNum() == j ? 1 : 0; const std::intptr_t ip = reinterpret_cast<std::intptr_t>(&ii);
return ip == j ? 1 : 0;
//return ii.ptrNum() == j ? 1 : 0;
} }
}; };