MCPcopy Create free account
hub / github.com/boostorg/parser / main

Function main

example/user_error_handler.cpp:79–95  ·  view source on GitHub ↗

[ using_logging_error_handler

Source from the content-addressed store, hash-verified

77
78//[ using_logging_error_handler
79int main()
80{
81 std::cout << "Enter a list of integers, separated by commas. ";
82 std::string input;
83 std::getline(std::cin, input);
84
85 constexpr auto parser = bp::int_ >> *(',' > bp::int_);
86 logging_error_handler error_handler("parse.log");
87 auto const result = bp::parse(input, bp::with_error_handler(parser, error_handler));
88
89 if (result) {
90 std::cout << "It looks like you entered:\n";
91 for (int x : *result) {
92 std::cout << x << "\n";
93 }
94 }
95}
96//]

Callers

nothing calls this directly

Calls 2

with_error_handlerFunction · 0.85
parseFunction · 0.70

Tested by

no test coverage detected