Take any STL container in mind which uses iterators.
The following is valid:
iterator begin();
const_iterator begin() const;
const_iterator cbegin() const;
Now I don't understand why the second line exists. Could someone provide a nice example where iterator begin(); wouldn't work and it can't be replaced by const_iterator cbegin();... begging the need for const_iterator begin();?
Aucun commentaire:
Enregistrer un commentaire