I wonder, what is supposed to happen with a call such as this?
#include <filesystem>
int main() {
std::filesystem::remove_all({});
return 0;
}
I guess path::empty() implies that my argument is an empty path, but this page does not have anything that I recognize as useful regarding empty paths.
Normal form of an empty path is an empty path. It is represented by
""(empty string) in the literal sense. And an empty path doesn’t exist as a real path on the filesystem of the OS. You can test this with:The program code in the OP
Will therefore be expected to behave according to the specification in the standard:
Since
std::filesystem::path{}doesn’t exist on the OS, the return value ofWill be
0. No files will be removed.