August 2012
Intermediate to advanced
976 pages
30h 17m
English
begin and end MembersThe begin and end operations (§ 3.4.1, p. 106) yield iterators that refer to the first and one past the last element in the container. These iterators are most often used to form an iterator range that encompasses all the elements in the container.
As shown in Table 9.2 (p. 330), there are several versions of begin and end: The versions with an r return reverse iterators (which we cover in § 10.4.3 (p. 407)). Those that start with a c return the const version of the related iterator:
list<string> a = {"Milton", "Shakespeare", "Austen"};auto it1 = a.begin(); // list<string>::iteratorauto it2 = a.rbegin(); // list<string>::reverse_iterator ...
Read now
Unlock full access