All pastes #244360 Raw Edit

Unnamed

public cpp v1 · immutable
#244360 ·published 2006-11-09 18:16 UTC
rendered paste body
istream& operator>>(istream &s, sample &p) {	int x;	double currdouble;	char larrow, semicolon, rarrow;		if ((s >> larrow) && (larrow == '<')) {		if ((s >> x >> semicolon) && (semicolon == ':')) { 			vector<double> vi(x);						for (int i = 0; i <= vi.size() - 1; i++) {				s >> currdouble;				vi[i] = currdouble;			}							if ((s >> rarrow) && (rarrow == '>'))				p = sample(vi);					}					else			s.setstate(ios::badbit); // read failed	}	return s;}