
7 Nov
2018
7 Nov
'18
12:41 a.m.
On 11/6/18 7:12 PM, rmawatson rmawatson via Boost-users wrote:
It's been a long while since I've used spirit::qi. But What it looks like is happeneing in your setup is something liek this,
When you have:
qi::rule<It, AST::full_id_t()> full_id;
the attribute is vector<string>
When it matches
id >> *(char_('.') >> id)
this has an attribute of vector<string,vector<tuple<char,std::string>>> or something similar. [snip]
One thing you can do is use qi::as<std::string>()[ id >> *(char_('.') >> id) ] to force conversion of synthesised attribute to a string to happen before it is assigned to your attribute. [snip]
rmawatson's as<std::string> suggestion works: https://coliru.stacked-crooked.com/a/a2c9435ee9e88bad Yeah rmawatson!