samedi 27 mai 2017

Copy const_iterator to std::string to save position

Is it legal to make snapshots of const_iterator from the std::string class without invalidating it when performing ++ operations.

For example: If want to save the position in a string so I copy the current const_iterator:

std::string::const_iterator it = prev;

Now my parser continues with prev++. Is it still valid and points to the previous position of prev?

Aucun commentaire:

Enregistrer un commentaire