front() returns a reference to the first element, begin() returns an iterator to it.
Note that you should not call front in an empty container, but it is normal to call begin if you do not find the iterator returned by begin .
Mark ransom
source share