Need an example of using itertools::PutBack::put_back in a loop

I am trying to use itertools::PutBack::put_back in a loop. It is the event loop of a lexical analyzer state machine. I keep running afoul of the borrow checker. Does anyone have an example of how to use put_back properly?

In particular, I will be iterating over the characters in a string.

I saw your question over on stack overflow so I answered it there.
https://stackoverflow.com/questions/56156814/can-i-use-itertoolsputbackput-back-in-a-loop

Thank you! I will read your answer...
... Read it. Very helpful.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.