What is the difference between the front()
and begin()
functions that appears in many STL containers?
begin()
returns an iterator that can be used to iterate through the collection, while front()
just returns a reference to the first element of the collection.