gulrak / filesystem

An implementation of C++17 std::filesystem for C++11 /C++14/C++17/C++20 on Windows, macOS, Linux and FreeBSD.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Warnings when building with Xcode 11.2

arnaudbrejeon opened this issue · comments

Describe the bug
I get the following warning when building with Xcode 11.2:

Loop variable 's' has type 'const ghc::filesystem::path::string_type &' (aka 'const basic_string<char> &') but is initialized with type 'const ghc::filesystem::path' resulting in a copy

Inside path::parent_path implementation, this line:
for (const string_type& s : input_iterator_range<iterator>(begin(), --end())) {

Loop variable 's' has type 'const ghc::filesystem::path::string_type &' (aka 'const basic_string<char> &') but is initialized with type 'const ghc::filesystem::path' resulting in a copy

Inside path::lexically_normal implementation, this line:
for (const string_type& s : *this) {

Loop variable 'part' has type 'const path::string_type &' (aka 'const basic_string<char> &') but is initialized with type 'const ghc::filesystem::path' resulting in a copy
Inside create_directories implementation, this line:
for (const path::string_type& part : p) {

Would it be possible to remove them?

Sure, I'll fix it.

Released with v1.2.8