I would like to access vector items in this way: I think this should be valid and really useful:
vector.back(-42)
vector.front(+42)
Is it doable in any way?
Update: I was asked "why"?: Just for simplicity and consistency with front() and back() access method.
Perhaps back() and front() were not intended as access methods but rather as a quick solution to first and last, which is often used.
Aucun commentaire:
Enregistrer un commentaire