Lets say I have a function called html() that returns a string of "<html>". It also saves it state so that the first time it returns "<html>", but the second time it returns "</html>", then on the third it goes back to "<html>";

If I have this code...
Code:
cout<<html();
cout<<html();
I get this output...
Code:
<html></html>
But if I have this code...
Code:
cout<<html()<<html();
I get...
Code:
</html><html>
Any way to get the second code to output like the first code?