Why are Standard iterator ranges [begin, end) instead of [begin, end]?
The best argument easily is the one made by Dijkstra himself: You want the size of the range to be a simple difference end − begin; including the lower bound is more “natural” when sequences degenerate to empty ones, and also because the alternative (excluding the lower bound) would require the existence of a “one-before-the-beginning” sentinel value. … Read more