aboutsummaryrefslogtreecommitdiff
path: root/zencore/include
diff options
context:
space:
mode:
authorPer Larsson <[email protected]>2021-11-01 14:36:39 +0100
committerPer Larsson <[email protected]>2021-11-01 14:36:39 +0100
commitff676a3e570563b2de32b61563b46a828437e4aa (patch)
tree2c7799b8f525c26f18b1cccfaeefa8355f0f9798 /zencore/include
parentUpload cache record before blobs and call finalize when processing upstream t... (diff)
parentMoved declaration of ZenDiskCacheLayer::CacheBucket in the .h (diff)
downloadzen-ff676a3e570563b2de32b61563b46a828437e4aa.tar.xz
zen-ff676a3e570563b2de32b61563b46a828437e4aa.zip
Merge branch 'main' of https://github.com/EpicGames/zen
Diffstat (limited to 'zencore/include')
-rw-r--r--zencore/include/zencore/sharedbuffer.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/zencore/include/zencore/sharedbuffer.h b/zencore/include/zencore/sharedbuffer.h
index 640c3fe74..1f87dc639 100644
--- a/zencore/include/zencore/sharedbuffer.h
+++ b/zencore/include/zencore/sharedbuffer.h
@@ -143,6 +143,12 @@ public:
/** Make a non-owned view of the input */
[[nodiscard]] inline static SharedBuffer MakeView(MemoryView View) { return MakeView(View.GetData(), View.GetSize()); }
+ /** Make a non-owning view of the memory of the contiguous container. */
+ [[nodiscard]] inline static SharedBuffer MakeView(const std::ranges::contiguous_range auto& Container)
+ {
+ std::span Span = Container;
+ return MakeView(Span.data(), Span.size() * sizeof(typename decltype(Span)::element_type));
+ }
/** Make a non-owned view of the input */
[[nodiscard]] ZENCORE_API static SharedBuffer MakeView(const void* Data, uint64_t Size);
/** Make a non-owned view of the input */