ghc::filesystem::path::operator/= () fails for std::string_views · Issue #81 · gulrak/filesystem · GitHub
Skip to content

ghc::filesystem::path::operator/= () fails for std::string_views #81

Description

@Febbe

Describe the bug
The /= operator can't handle std::string_views

To Reproduce
ghc::filesystem::path{"XYZ"} /= "Appendix"sv doesn't work`

Expected behavior
I would expect that a compiler compiling with c++17 support won't fail.

Additional context
using macOS 10.13 "High Sierra" with XCode 10.1
using ghc version 1.3.2

In file included from src/filesystem.h:14:
external/Source/ghcFilesystem_git/include/ghc/filesystem.hpp:2185:34: error: no matching function for call to 'toUtf8'
    return this->operator/=(path(detail::toUtf8(source)));
                                 ^~~~~~~~~~~~~~
external/Source/ghcFilesystem_git/include/ghc/filesystem.hpp:2179:12: note: in instantiation of function template specialization 'ghc::filesystem::path::append<std::__1::basic_string_view<char, std::__1::char_traits<char> > >' requested here
    return append(source);
           ^
../src/util/PathUtil.cpp:158:15: note: in instantiation of function template specialization 'ghc::filesystem::path::operator/=<std::__1::basic_string_view<char, std::__1::char_traits<char> > >' requested here
    return (p /= CONFIG_FOLDER_NAME);
              ^
external/Source/ghcFilesystem_git/include/ghc/filesystem.hpp:1383:20: note: candidate template ignored: could not match 'basic_string' against 'basic_string_view'
inline std::string toUtf8(const std::basic_string<charT, traits, Alloc>& unicodeString)
                   ^
external/Source/ghcFilesystem_git/include/ghc/filesystem.hpp:1389:20: note: candidate template ignored: could not match 'basic_string' against 'basic_string_view'
inline std::string toUtf8(const std::basic_string<charT, traits, Alloc>& unicodeString)
                   ^
external/Source/ghcFilesystem_git/include/ghc/filesystem.hpp:1418:20: note: candidate template ignored: could not match 'basic_string' against 'basic_string_view'
inline std::string toUtf8(const std::basic_string<charT, traits, Alloc>& unicodeString)
                   ^
external/Source/ghcFilesystem_git/include/ghc/filesystem.hpp:1428:20: note: candidate template ignored: could not match 'const charT *' against 'std::__1::basic_string_view<char, std::__1::char_traits<char> >'
inline std::string toUtf8(const charT* unicodeString)
                   ^
1 error generated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

available on masterFix is done on master branch, issue closed on next releasebugSomething isn't working

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions