From e7b12e77925ed93911bf3fd6315381b958f14f4c Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Fri, 20 Apr 2018 15:04:12 +1000 Subject: [PATCH] alloc/raw/linear: add offset overload for views --- alloc/raw/linear.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/alloc/raw/linear.hpp b/alloc/raw/linear.hpp index a63f73aa..dd5f0167 100644 --- a/alloc/raw/linear.hpp +++ b/alloc/raw/linear.hpp @@ -52,6 +52,13 @@ namespace util::alloc::raw { size_t offset (const void*) const; + template + size_t + offset (util::view ptr) const + { + return offset (ptr.data ()); + } + void reset (void); size_t capacity (void) const;