Is is possible to try to read from a stream but do not change the stream itself (and return bool whether it was a success)?
template <typename T> bool SilentRead (stringstream& s, T& value) {
stringstream tmp = s;
tmp >> value;
return tmp;
}
This doesn't work because stringstream doesn't have public copy constructor. How to do it then?
Is it possible to solve it if we replace stringstream with istream ?