aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/zencore/include/zencore/memory.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/zencore/include/zencore/memory.h b/src/zencore/include/zencore/memory.h
index 6965b76b1..6419252ff 100644
--- a/src/zencore/include/zencore/memory.h
+++ b/src/zencore/include/zencore/memory.h
@@ -356,7 +356,7 @@ template<ContiguousRange R>
MakeMemoryView(const R& Container)
{
std::span Span = Container;
- return MemoryView(Span.data(), Span.size() * sizeof(typename decltype(Span)::element_type));
+ return MemoryView(Span.data(), Span.size_bytes());
}
/** Make a non-owning const view starting at Data and ending at DataEnd. */
@@ -391,7 +391,7 @@ template<ContiguousRange R>
MakeMutableMemoryView(R& Container)
{
std::span Span = Container;
- return MutableMemoryView(Span.data(), Span.size() * sizeof(typename decltype(Span)::element_type));
+ return MutableMemoryView(Span.data(), Span.size_bytes());
}
/** Make a non-owning mutable view starting at Data and ending at DataEnd. */