+ </pre>
+ <p>See? Everything between the boundary markers is part of the array.
+ Simple.
+ </p>
+ <p>Now think back to your junior-high school algebra course, when you
+ were learning how to draw graphs. Remember that a graph terminating
+ with a solid dot meant, "Everything up through this point,"
+ and a graph terminating with an open dot meant, "Everything up
+ to, but not including, this point," respectively called closed
+ and open ranges? Remember how closed ranges were written with
+ brackets, <em>[a,b]</em>, and open ranges were written with parentheses,
+ <em>(a,b)</em>?
+ </p>
+ <p>The boundary markers for arrays describe a <em>half-open range</em>,
+ starting with (and including) the first element, and ending with (but
+ not including) the last element: <em>[beginning,end)</em>. See, I
+ told you it would be simple in the end.
+ </p>
+ <p>Iterators, and everything working with iterators, follows this same
+ time-honored tradition. A container's <code>begin()</code> method returns
+ an iterator referring to the first element, and its <code>end()</code>
+ method returns a past-the-end iterator, which is guaranteed to be
+ unique and comparable against any other iterator pointing into the
+ middle of the container.
+ </p>
+ <p>Container constructors, container methods, and algorithms, all take
+ pairs of iterators describing a range of values on which to operate.
+ All of these ranges are half-open ranges, so you pass the beginning
+ iterator as the starting parameter, and the one-past-the-end iterator
+ as the finishing parameter.
+ </p>
+ <p>This generalizes very well. You can operate on sub-ranges quite
+ easily this way; functions accepting a <em>[first,last)</em> range
+ don't know or care whether they are the boundaries of an entire {array,
+ sequence, container, whatever}, or whether they only enclose a few
+ elements from the center. This approach also makes zero-length
+ sequences very simple to recognize: if the two endpoints compare
+ equal, then the {array, sequence, container, whatever} is empty.
+ </p>
+ <p>Just don't dereference <code>end()</code>.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>