Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Febbe opened this issue Dec 9, 2020 · 3 comments
Closed

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

Febbe opened this issue Dec 9, 2020 · 3 comments
Assignees
Labels
available on master Fix is done on master branch, issue closed on next release bug Something isn't working
Milestone

Comments

@Febbe
Copy link

Febbe commented Dec 9, 2020

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.
@gulrak gulrak added the bug Something isn't working label Dec 9, 2020
@gulrak gulrak self-assigned this Dec 9, 2020
@gulrak gulrak added this to the v1.3.10 milestone Dec 9, 2020
@gulrak
Copy link
Owner

gulrak commented Dec 9, 2020

Indeed, I'll look into it. Thanks for reporting!

@gulrak gulrak added the available on master Fix is done on master branch, issue closed on next release label Dec 26, 2020
@gulrak
Copy link
Owner

gulrak commented Dec 26, 2020

Sorry it took so long, but I had a lot of paid work to do before the Hollidays so I had to delay working on this. Will bundle v1.3.10 later today or tomorrow at latest.

@gulrak
Copy link
Owner

gulrak commented Dec 27, 2020

This is now part of release v1.3.10

@gulrak gulrak closed this as completed Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
available on master Fix is done on master branch, issue closed on next release bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants