diff --git a/src/include/multi_array_operation.cc.h b/src/include/multi_array_operation.cc.h index 39e1d8d..956e702 100644 --- a/src/include/multi_array_operation.cc.h +++ b/src/include/multi_array_operation.cc.h @@ -135,9 +135,11 @@ namespace MultiArrayTools return OperationPointer(THIS()); } + template template - HyperOperation ho(const std::shared_ptr& inds...) const + auto OperationBase::ho(const std::shared_ptr& inds...) const { + typedef XX SubOp; return HyperOperation() } @@ -145,32 +147,17 @@ namespace MultiArrayTools * AssignmentExpr * ************************/ - template - struct OpIndexResolve - {}; - - template <> - struct OpIndexResolve + template + inline size_t opIndexResolve(size_t start, ExtType last) { - - template - static inline size_t get(size_t start, ExtType last) - { + if constexpr(OIA == OpIndexAff::EXTERN){ return last.val(); } - - }; - - template <> - struct OpIndexResolve - { - template - static inline size_t get(size_t start, ExtType last) - { + if constexpr(OIA == OpIndexAff::TARGET){ return start; } - }; - + return 0; + } template AssignmentExpr::AssignmentExpr(T* dataPtr, const Target& tar, const OpClass& sec) : @@ -181,13 +168,13 @@ namespace MultiArrayTools { ExtType last = rootSteps(); last.zero(); - IOp::f(mDataPtr,OpIndexResolve::get(start,last),mSec,last.next()); + IOp::f(mDataPtr,opIndexResolve(start,last),mSec,last.next()); } template inline void AssignmentExpr::operator()(size_t start, ExtType last) { - IOp::f(mDataPtr,OpIndexResolve::get(start,last),mSec,last.next()); + IOp::f(mDataPtr,opIndexResolve(start,last),mSec,last.next()); } template