
Thanks, I changed it to a lazy function as suggested, and then it works.
Just for the record:
struct Ipv4Address : qi::grammar
Sorry for not providing the simplest possible code to reproduce my problem, but I'm still new to spirit, I think I will miss some details in the conversion.
I tried add the inclusion you suggested, but it did not help.
Sorry, although it works for boost::tuple, it won't work for your Ipv4 struct... But a simple workaround can solve this issue: in Ipv4Address grammar change attribute to boost::tuple
, and in your parse() function use tuple type as temporary, then copy it to Ipv4 argument (you use a temporary anyway). Like this: bool parse(const const_string& s, Ipv4& i) { boost::tuple _i; const char * iter = s.begin(); bool r = qi::parse(iter, s.end(), ipv4_address, _i); if( !r || iter != s.end() ) return false;
i = Ipv4(_i); return true; } _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users