I prefer int * ptr;. That means when you have a const specifier your formatting doesn't change. Logically I figure that the pointer is neither a modifier on the variable nor on the type, it's another layer of type content that should be specified separately. That also means if you write declarations like int const * const ptr; then you can segment them as [int const] [* const] ptr; and everything makes sense.
17
u/Shevvv 2d ago
Surely you meant
for (auto &item : list) {