From 1d560c8f0feb9156d62a0a9b4708ae7a8e8a8241 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 13 Mar 2020 19:46:12 +0100 Subject: [PATCH] fs/AllocatedPath: add `string_view` constructor --- src/fs/AllocatedPath.hxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/fs/AllocatedPath.hxx b/src/fs/AllocatedPath.hxx index cdd53b327..097217c7b 100644 --- a/src/fs/AllocatedPath.hxx +++ b/src/fs/AllocatedPath.hxx @@ -47,6 +47,9 @@ class AllocatedPath { explicit AllocatedPath(const_pointer _value) noexcept :value(_value) {} + explicit AllocatedPath(string_view _value) noexcept + :value(_value) {} + AllocatedPath(const_pointer _begin, const_pointer _end) noexcept :value(_begin, _end) {} @@ -141,6 +144,11 @@ public: return AllocatedPath(fs); } + gcc_pure + static AllocatedPath FromFS(string_view fs) noexcept { + return AllocatedPath(fs); + } + gcc_pure static AllocatedPath FromFS(const_pointer _begin, const_pointer _end) noexcept {