From 189f6eaa6f9b6e3eab8d26097cd4045eee8a7a13 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 13 Mar 2020 19:43:39 +0100 Subject: [PATCH] fs/Traits: add string_view --- src/fs/AllocatedPath.hxx | 1 + src/fs/Traits.hxx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/fs/AllocatedPath.hxx b/src/fs/AllocatedPath.hxx index 09e805dfe..cdd53b327 100644 --- a/src/fs/AllocatedPath.hxx +++ b/src/fs/AllocatedPath.hxx @@ -37,6 +37,7 @@ class AllocatedPath { using Traits = PathTraitsFS; using string = Traits::string; + using string_view = Traits::string_view; using value_type = Traits::value_type; using pointer = Traits::pointer; using const_pointer = Traits::const_pointer; diff --git a/src/fs/Traits.hxx b/src/fs/Traits.hxx index a6a99634e..72cdc0ba2 100644 --- a/src/fs/Traits.hxx +++ b/src/fs/Traits.hxx @@ -44,8 +44,10 @@ struct PathTraitsFS { #ifdef _WIN32 using string = std::wstring; + using string_view = std::wstring_view; #else using string = std::string; + using string_view = std::string_view; #endif using char_traits = string::traits_type; using value_type = char_traits::char_type; @@ -177,6 +179,7 @@ struct PathTraitsFS { */ struct PathTraitsUTF8 { using string = std::string; + using string_view = std::string_view; using char_traits = string::traits_type; using value_type = char_traits::char_type; using pointer = value_type *;