bool Reader::parse(std::istream& sin, Value& root, bool collectComments) {
std::string doc;
std::getline(sin, doc, (char)EOF); // WRONG!
return parse(doc, root, collectComments);
}
Problem: Using EOF as a delimiter in std::getline() is wrong. EOF is a constant (typically -1) that's not a valid character for stream reading. This will cause undefined behavior.
EOF = 0xFF - CP1251 - char('я') - the last letter of the alphabet :)
error parse json