diff --git a/src/include/multi_array.cc.h b/src/include/multi_array.cc.h index ecbf9b1..facf01b 100644 --- a/src/include/multi_array.cc.h +++ b/src/include/multi_array.cc.h @@ -73,6 +73,17 @@ namespace MultiArrayTools } } + template + template + MultiArray::MultiArray(const std::shared_ptr&... ranges, MultiArray&& in) : + MutableMultiArrayBase(ranges...), + mCont( std::move( in.mCont ) ) + { + // maybe some checks here in the future... + assert(mCont.size() == MAB::mRange->size()); + MAB::mInit = true; + } + template MultiArray::MultiArray(MultiArray&& ama, SIZET... sizes) : MutableMultiArrayBase diff --git a/src/include/multi_array.h b/src/include/multi_array.h index 1c4e367..955fe44 100644 --- a/src/include/multi_array.h +++ b/src/include/multi_array.h @@ -42,7 +42,11 @@ namespace MultiArrayTools MultiArray(const std::shared_ptr&... ranges, const T& val); MultiArray(const std::shared_ptr&... ranges, const vector& vec); MultiArray(const std::shared_ptr&... ranges, vector&& vec); - MultiArray(const typename CRange::Space& space); + + template + MultiArray(const std::shared_ptr&... ranges, MultiArray&& in); // same effect as format + + MultiArray(const typename CRange::Space& space); MultiArray(const typename CRange::Space& space, vector&& vec); MultiArray(MultiArray&& ama, SIZET... sizes);