single range: fix cmeta size for vector case
This commit is contained in:
parent
0acfb6e171
commit
5f694c9103
1 changed files with 11 additions and 1 deletions
|
@ -232,6 +232,11 @@ namespace MultiArrayTools
|
|||
*reinterpret_cast<U*>(target) = elem;
|
||||
return sizeof(U);
|
||||
}
|
||||
|
||||
static inline size_t size(const U& elem)
|
||||
{
|
||||
return sizeof(U);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename V>
|
||||
|
@ -245,6 +250,11 @@ namespace MultiArrayTools
|
|||
}
|
||||
return o;
|
||||
}
|
||||
|
||||
static inline size_t size(const vector<V>& elem)
|
||||
{
|
||||
return elem.size();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename U, SpaceType TYPE, size_t S>
|
||||
|
@ -631,7 +641,7 @@ namespace MultiArrayTools
|
|||
template <typename U, SpaceType TYPE, size_t S>
|
||||
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>
|
||||
|
|
Loading…
Reference in a new issue