Going back in istringstream

Is there a recommended or easy way to make an istringstream go back to before the last extraction performed, so it will extract the word again?
I tried with seekg(word.size() - 1, std::ios::cur) but it seems to set some errorflag: while(stream >> word) fails and the loop exits.
ss.seekg(int(-word.size()), ios::cur);
Thank you, worked perfectly.
Topic archived. No new replies allowed.