2
0
mirror of https://github.com/boostorg/parser.git synced 2026-01-24 18:12:32 +00:00

Emit parse errors via callback instead of just dumping them to the console.

This commit is contained in:
Zach Laine
2018-09-27 21:04:49 -05:00
parent 7a82f505b0
commit 5be1c00730
4 changed files with 85 additions and 71 deletions

View File

@@ -9,7 +9,8 @@ int main()
break;
boost::optional<boost::json::value> value;
if ((value = boost::json::parse(str))) {
if ((value = boost::json::parse(
str, [](std::string const & msg) { std::cout << msg; }))) {
std::cout << "Parsed value:\n";
std::cout << *value << std::endl;
}