| 96 | }}} |
| 97 | |
| 98 | int main() |
| 99 | { |
| 100 | typedef std::string::const_iterator iterator_type; |
| 101 | typedef boost::array<int, 2> array_type; |
| 102 | typedef client::result_of::adapt_array<array_type>::type adapted_type; |
| 103 | |
| 104 | array_type arr; |
| 105 | |
| 106 | std::string str = "1 2"; |
| 107 | iterator_type iter = str.begin(); |
| 108 | iterator_type end = str.end(); |
| 109 | |
| 110 | qi::rule<iterator_type, adapted_type(), ascii::space_type> r = *qi::int_; |
| 111 | |
| 112 | adapted_type attr = client::adapt_array(arr); |
| 113 | bool result = qi::phrase_parse(iter, end, r, ascii::space, attr); |
| 114 | |
| 115 | if (result) |
| 116 | std::cout << "Parsed: " << arr[0] << ", " << arr[1] << std::endl; |
| 117 | |
| 118 | return 0; |
| 119 | } |
nothing calls this directly
no test coverage detected