istream& operator>>(istream& is, reflex& r); { string line; //Input the pattern. if (!getline(is, line)) { is.clear(ios_base::badbit); return is; } r.pattern = chop(line); //Input one or more responses. while (getline(is, line) && line != "") { r.responses.push_back(chop(line)); } if (r.responses.empty()) { is.clear(ios_base::badbit); return is; } random_shuffle(r.responses.begin(), r.responses.end()); r.current = r.responses.begin(); return is; }