> Is there a generally accepted best practice when one needs a `type`,
> but has a
> rule. I have been using boost::mpl to configuration an application,
> and types are of course much easier to metaprogram.
> In my application, it would be nice if I could encorporate a rule such as
> auto const qs = rule<class qs, std::string>(“quoted string”) = lexeme['"' >> *(char_ - '"') >> '"’];
> into a type such as `qs_`. I guess I could use `decltype` of a lambda in a pinch, but I was hoping for a more general best practice.
typedef or decltype, depending on what you're trying to achieve exactly.
Note, however, that the string "quoted string" and the actual rule
assignment is not part of the type. If you reuse the type of that rule
somewhere else, you will have to reprovide a rule name, in case you want
to have a named rule. Same for the actual rule content.
However, I am not sure if I understand what you are looking for
exactly. Can you provide a more concrete example?