1

I'm getting a

"qi::_10 is not a member of qi "

error when compiling grammar for qi.

Is there a way to increase the maximum allowed?

Danny
  • 391
  • 2
  • 12
  • Passing large numbers of arguments is a code smell even without template expressions. I'd say it stinks in this context. Can you give us a small example that would require this? We might be able to suggest a simpler solution. – sehe Jan 05 '19 at 02:04

1 Answers1

0

Off-hand: Avoid the code smell of large numbers of function arguments.

That said,

Before:

Live On Coliru

#define SPIRIT_ARGUMENTS_LIMIT 10
#include <boost/spirit/include/qi.hpp>

int main() {
    auto& _10 = boost::spirit::labels::_10;
}

After:

Live On Coliru

#define SPIRIT_ARGUMENTS_LIMIT 11
#include <boost/spirit/include/qi.hpp>

int main() {
    auto& _10 = boost::spirit::labels::_10;
}

BONUS

You can cheat and hard-code your own placeholders:

boost::phoenix::actor<boost::spirit::argument<998> > const _999;

Note the discrepancy between 998 and _999; this is an implementation detail that is not documented, so it's probably better not rely on it, or at least have tests.

sehe
  • 374,641
  • 47
  • 450
  • 633