From af3d35cc1d9c456be32d40732ffbc11c287f4430 Mon Sep 17 00:00:00 2001 From: Jonas Karlsson Date: Wed, 14 Aug 2019 16:33:31 +0200 Subject: [PATCH] Fix missing string_view path method --- include/ghc/filesystem.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/ghc/filesystem.hpp b/include/ghc/filesystem.hpp index 77451b4..2d1f826 100644 --- a/include/ghc/filesystem.hpp +++ b/include/ghc/filesystem.hpp @@ -1475,6 +1475,15 @@ inline path::path(const std::u32string& source, format fmt) postprocess_path_with_format(_path, fmt); } +#ifdef __cpp_lib_string_view +template <> +inline path::path(const std::string_view& source, format fmt) +{ + _path = detail::toUtf8(std::string(source)); + postprocess_path_with_format(_path, fmt); +} +#endif + template inline path u8path(const Source& source) {