Btw it's inefficient because we're calling copy constructor?
And what can be the efficient way then
You could just store the next value to be returned as a state within your object and return it for subsequent peek calls. Update this state when next is called.
Anonymous
klimi
Roxifλsz 🇱🇹
Ludovic 'Archivist'
Dima