auto directory_contents(auto path) {
auto iterator = std::filesystem::directory_iterator(path);
return std::vector<std::filesystem::path>(
std::ranges::begin(iterator),
std::ranges::end(iterator)
);
}
auto main(int argc, char** argv) -> int {
auto path = argc >= 2
? std::filesystem::path(argv[1])
: std::filesystem::current_path();
for (auto entry : directory_contents(path)) {
std::cout << entry.string() << std::endl;
}
}