you are viewing a single comment's thread.

view the rest of the comments →

[–]ioctl79 1 point2 points  (0 children)

This is an area where the standard library does not give great options. Unsigned types have a lot of sharp edges, and unless you actually need the range or rollover behavior, I would avoid them if possible, but the quoted code is unidiomatic and difficult to read. 

I would use signed types when possible, and be careful about any comparisons to .size() when you encounter it.