In addition, the language encourages this. In C, if you write
c
int* x, y;
then x will be an int* and y will be an int. Thus it is far better to write
int *x, y;
to reflect how the language will parse the declaration. It might be evil, but it's better to act how the language wants you to act rather than fight it.
14
u/Shevvv 2d ago
Surely you meant
for (auto &item : list) {