This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
std::filesystem::path::append oddity
- From: NightStrike <nightstrike at gmail dot com>
- To: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Sun, 17 Jun 2018 18:00:52 -0400
- Subject: 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() };