Unlike pointers, we do not use the address-of operator to obtain an iterator. Instead, types that have iterators have members that return iterators. In particular, these types have members named
begin member returns an iterator that denotes the first element (or first character), if there is one:
// the compiler determines the type of b and e; see § 2.5.2 (p. 68)// b denotes the first element and e denotes one past the last element in vauto b = v.begin(), e = v.end(); // b and e have the same type
The iterator returned by
end is an iterator positioned “one past the end” of the associated container (or ...