クラスFooの入力ストリーム演算子の中で整数を2個読むとして、
std::istream& operator>>(std::istream& os, Foo& obj) {
 int x, y;
 os >> x >> y;
 if (!os.goot()) {
  return os; // エラー発生時は単純にreturn os; でおk?
 }
 obj.m_x = x;
 obj.m_y = y;
 return os;
}