single range: fix cmeta size for vector case

This commit is contained in:
Christian Zimmermann 2019-09-03 19:33:30 +02:00
parent 0acfb6e171
commit 5f694c9103

View file

@ -232,6 +232,11 @@ namespace MultiArrayTools
*reinterpret_cast<U*>(target) = elem; *reinterpret_cast<U*>(target) = elem;
return sizeof(U); return sizeof(U);
} }
static inline size_t size(const U& elem)
{
return sizeof(U);
}
}; };
template <typename V> template <typename V>
@ -245,6 +250,11 @@ namespace MultiArrayTools
} }
return o; return o;
} }
static inline size_t size(const vector<V>& elem)
{
return elem.size();
}
}; };
template <typename U, SpaceType TYPE, size_t S> template <typename U, SpaceType TYPE, size_t S>
@ -631,7 +641,7 @@ namespace MultiArrayTools
template <typename U, SpaceType TYPE, size_t S> template <typename U, SpaceType TYPE, size_t S>
size_t GenSingleRange<U,TYPE,S>::cmetaSize() const size_t GenSingleRange<U,TYPE,S>::cmetaSize() const
{ {
return sizeof(U); return ToCMeta<U>::size(mSpace[0])*sizeof(U);
} }
template <typename U, SpaceType TYPE, size_t S> template <typename U, SpaceType TYPE, size_t S>