4 ms·
I would personally use for loop without size_t. It is short and simple and works as intended, anyone can understand it.
by DethNinja 6y ago
I would personally use for loop without size_t. It is short and simple and works as intended, anyone can understand it.
- HelloNurse 6y agoDo you mean with decltype(std::declval<const Image&>().width) as the article suggests? Or with an ad-hoc typedef, e.g. Image::size_type? Or with a fixed type that should work correctly? This use of auto is particularly valuable.
- DethNinja 6y agoHonestly I would just use auto. I favor heavy use of auto actually, if you got a modern IDE auto is a really great feature.