|
|
|
|
|
by UncleOxidant
17 days ago
|
|
Reading this, I really can't make much sense of it: for (int i=0; auto&& it: vec)
cout << (++i) << ": " << it << endl;
It's certainly not obvious what's going on there at a glance.This is at least a bit more pythonic: for (auto [i, it] : std::views::enumerate(vec)) {
std::cout << i << ": " << it << "\n";
}
|
|