It is possible to append multiple paths in a row using the /
operator:
std::filesystem::path p1{"A"};
auto p2 = p1 / "B" / "C";
which is rather convenient. However, concat only offers +=
:
std::filesystem::path p1{"A"};
auto p2 = p1 / "B" / "C" + ".d"; // NOT OK
This is pretty annoying, as I can't easily add extensions to the end of my paths. I have no choice but to write something like
std::filesystem::path p1{"A"};
auto p2 = p1 / "B" / "C";
p2 += ".d";
Am I missing something? Is there a reason for this inconsistency?