Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct print_action
- {
- template <typename Context>
- void operator()(Context const& ctx) const
- {
- cout << _attr(ctx) << endl;
- }
- };
- auto description = *(char_ - eol) >> eol;
- auto numbers = int_ >> int_ >> int_;
- auto point = double_ >> double_ >> double_;
- auto element = int_ >> *(char_) >> int_ >> int_ >> int_;
- auto points = skip(blank) [
- *(point >> eol)
- ];
- auto elements = skip(blank) [
- *(element >> eol)
- ];
- auto pr = [&] (auto& ctx) {
- cout << "desc = " << _attr(ctx) << endl;
- };
- auto pr2 = [] (auto& ctx) {
- cout << _attr(ctx) << endl;;
- };
- auto input = description[pr]
- >> numbers[pr]
- >> points
- >> elements;
- /*
- The above works unless I add a symantic action to numbers. '>> numbers' works, 'numbers[pr]' doesn't. Anyone know why?
- */
Advertisement
Add Comment
Please, Sign In to add comment