Is it possibile to ignore punctuacion using std manipulator on cin? For example suppose you have an input stream (in the actual case a file) like: “one, two three”. I want to be able to do:
f >> ignore_punct >> a;
f >> ignore_punct >> b;
f >> ignore_punct >> c;
at the end a=="one", b=="two", c=="three".
Try this:
It uses the local to filter out punctuation.
This allows the rest of the code to remain unchanged.