This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

std::filesystem::path::append oddity


I'm probably missing something abundantly obvious here, but shouldn't these
two methods of appending be the same according to
https://en.cppreference.com/w/cpp/filesystem/path/append variants 2 and 3?

#include <filesystem>
#include <string>
namespace fs = std::filesystem;

void f() {
        fs::path p;
        p /= fs::path("s");  // works
        p.append(fs::path("s"));  // doesn't
}

It appears like clang doesn't support it, either.  The downside here is
that it prevents being able to do the following:

ifstream if { p.append(...).c_str() };


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]