std::filesystem::path::append oddity

Sun Jun 17 22:01:00 GMT 2018

I'm probably missing something abundantly obvious here, but shouldn't these
two methods of appending be the same according to 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() };

More information about the Gcc-help mailing list