From 5f694c9103f83f87990aad133a68edcb188193a0 Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Tue, 3 Sep 2019 19:33:30 +0200 Subject: [PATCH] single range: fix cmeta size for vector case --- src/include/ranges/single_range.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/include/ranges/single_range.h b/src/include/ranges/single_range.h index 9f0a922..e6318ec 100644 --- a/src/include/ranges/single_range.h +++ b/src/include/ranges/single_range.h @@ -232,6 +232,11 @@ namespace MultiArrayTools *reinterpret_cast(target) = elem; return sizeof(U); } + + static inline size_t size(const U& elem) + { + return sizeof(U); + } }; template @@ -245,6 +250,11 @@ namespace MultiArrayTools } return o; } + + static inline size_t size(const vector& elem) + { + return elem.size(); + } }; template @@ -631,7 +641,7 @@ namespace MultiArrayTools template size_t GenSingleRange::cmetaSize() const { - return sizeof(U); + return ToCMeta::size(mSpace[0])*sizeof(U); } template