Skip to content

Commit 4b10425

Browse files
authored
Merge pull request #25 from karjonas/string_view
Fix missing string_view path specialization for C++17 support
2 parents b652667 + af3d35c commit 4b10425

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/ghc/filesystem.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,6 +1475,15 @@ inline path::path(const std::u32string& source, format fmt)
14751475
postprocess_path_with_format(_path, fmt);
14761476
}
14771477

1478+
#ifdef __cpp_lib_string_view
1479+
template <>
1480+
inline path::path(const std::string_view& source, format fmt)
1481+
{
1482+
_path = detail::toUtf8(std::string(source));
1483+
postprocess_path_with_format(_path, fmt);
1484+
}
1485+
#endif
1486+
14781487
template <class Source, typename>
14791488
inline path u8path(const Source& source)
14801489
{

0 commit comments

Comments
 (0)