Open DoumanAsh opened 6 years ago
Currently passing failed/bad stream results in successful parsing(which actually parses nothing at all).
Simple case would be pass ifstream to non-existing fail
std::ifstream ifs("foo.toml"); toml::ParseResult pr = toml::parse(ifs); if (!pr.valid()) { cout << pr.errorReason << endl; return; }
It is a bit tricky as it should be up to user to provide a valid output. But on other hand there is no way it would be possible parse failed/bad stream.
What do you think? Should there be error on such cases?
@DoumanAsh Thanks for reporting... Yeah, I think it's not good. It should be an error. I'll fix it.
Currently passing failed/bad stream results in successful parsing(which actually parses nothing at all).
Simple case would be pass ifstream to non-existing fail
It is a bit tricky as it should be up to user to provide a valid output. But on other hand there is no way it would be possible parse failed/bad stream.
What do you think? Should there be error on such cases?