August 2012
Intermediate to advanced
976 pages
30h 17m
English
Table 9.6 lists the operations we can use to access elements in a sequential container. The access operations are undefined if the container has no elements.
Table 9.6. Operations to Access Elements in a Sequential Container
Each sequential container, including array, has a front member, and all except forward_list also have a back member. These operations return a reference to the first and last element, respectively:
// check that there are elements before dereferencing an iterator or calling front or backif (!c.empty()) ...
Read now
Unlock full access