There's more...

Apart from begin() and end(), a container may have additional methods such as cbegin()/cend() (for constant iterators), rbegin()/rend() (for mutable reverse iterators), and crbegin()crend() (for constant reverse iterators). Implementing this is left as an exercise for you.

On the other hand, in modern C++, these functions that return the first and last iterators do not have to be member functions but can be provided as non-member functions. In fact, this is the topic of the next recipe, Container access with non-member functions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset