How can I use polymorphic attributes with boost::spirit::qi parsers?
I would like my boost::spirit-based parser to be able to parse a file, convert the parsed rules into different types, and emit a vector containing all of the matches it found. All of the types that are emitted as attributes should be inherited from a base type, for example: #include <boost/spirit/include/qi.hpp> #include <boost/fusion/adapt_struct.hpp> #include <boost/shared_ptr.hpp> #include <boost/foreach.hpp> struct CommandBase { virtual void commandAction() { std::cout << "This is a base command. You should never see this!" << std::endl; //Boost::spirit seems to get mad if I make this