I've suddenly found a solution like this:
Hello Boost Users,I'm now building configuration file parser with Boost.Spirit.I have a little trouble understanding how this parser builds attribute:It was supposed to parse strings throwing 'p' letter away.*((qi::char_ - 'p') | qi::lit('p'))attribute of qi::lit is Unused.attribute of (qi::char_ - 'p') is char.so attribute of ((qi::char_ - 'p') | qi::lit('p')) should be optional<char> thatis uninitialized optional value when matched against character 'p'After applying Kleene star it should became vector<optional<char> >.It seems to be compatible with string (at least it compiles). But 'p' lettersare not thrown away.The full example is here: http://pastebin.com/tCMw22ZyThe output of that example is:Full parsingResult: "abcpppdef"Is it possible to make such a parser without using semantic actionslike [bind(&string::append, res, _1)] or something like that, which seemto be less elegant solution.Thanks!