All pastes #243674 Raw Edit

Kederaji

public cpp v1 · immutable
·published 2006-11-08 20:00 UTC
rendered paste body
istream& operator>>(istream &s, Point &p) {  int x, y;  char lpar, comma, rpar;  if (s >> lpar) {    if ((s >> x >> comma >> y >> rpar) &&        (lpar == '(' && comma == ',' && rpar == ')'))      p = Point(x, y);    else      s.setstate(ios::badbit); // read failed  }  return s;}//Do not, I repeat, DO NOT print anything when reading!//And try to read from s, not cin . . .