From: Joel de G. <dj...@gm...> - 2014-10-25 22:26:41
|
On 10/23/14, 6:22 PM, Kees-Jan Dijkzeul wrote: > I have a trivial struct, adapted for boost::fusion: > > struct Node > { > std::string text; > }; > > BOOST_FUSION_ADAPT_STRUCT(Node, (std::string, text)) > > I have a grammar with a set of rules: > > qi::rule<Iterator, Node()> node_line; > qi::rule<Iterator, Node()> node; > > And there is one rule that blows up in my face: > > node_line %= " * " >> node; > > I would expect this to be valid, since the attribute of the literal is > unused, and node_line and node have the same attribute type. Instead > the compiler complains: > > /usr/include/boost/spirit/home/support/container.hpp:262:13: error: no > matching function for call to > ‘std::basic_string<char>::insert(std::basic_string<char>::iterator, > const Node&)’ > > I.e. the compiler tries to append a struct Node onto a std::string. I > am utterly confused as to why it would try to do that. Any thoughts? > > For a full program showing this problem, as well as the full compiler > error, please visit > http://stackoverflow.com/questions/26507932/boostspirit-attribute-types-not-collapsing You found a bug. I am working on it. I found where that is happening ( the compiler tries to append a struct Node onto a std::string), and I know how to fix it, but I just want to be sure that my fix will not affect other code, in general. Regards, -- Joel de Guzman http://www.ciere.com http://boost-spirit.com http://www.cycfi.com/ |