Why does stringstream >> change value of target on failure?
From this reference: If extraction fails (e.g. if a letter was entered where a digit is expected), value is left unmodified and failbit is set (until C++11) If extraction fails, zero is written to value and failbit is set. If extraction results in the value too large or too small to fit in value, std::numeric_limits::max() … Read more