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

Function main

example/struct_rule.cpp:37–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35BOOST_PARSER_DEFINE_RULES(quoted_string, employee_p);
36
37int main()
38{
39 std::cout << "Enter employee record. ";
40 std::string input;
41 std::getline(std::cin, input);
42
43 static_assert(std::is_aggregate_v<std::decay_t<employee &>>);
44
45 auto const result = bp::parse(input, employee_p, bp::ws);
46
47 if (result) {
48 std::cout << "You entered:\nage: " << result->age
49 << "\nsurname: " << result->surname
50 << "\nforename: " << result->forename
51 << "\nsalary : " << result->salary << "\n";
52 } else {
53 std::cout << "Parse failure.\n";
54 }
55}
56//]

Callers

nothing calls this directly

Calls 1

parseFunction · 0.70

Tested by

no test coverage detected