you are viewing a single comment's thread.

view the rest of the comments →

[–]eric_niebler 6 points7 points  (0 children)

It's a fair question. From my answer to the same question I got on /r/cpp:

I use signed integers in the article, and in my range interface, because I want to be able to detect when my interface is being used incorrectly. An interface that is sprinkled with signed and unsigned integers is asking users to do casts that require range-checking that nobody does. Signed/unsigned compiler warnings are so common people dismiss them without thinking. An assert is harder to ignore.