
Thanks Troy! I just wanted to start investigating and - voila! You already did it! I'll incorporate your patch asap. Regards Hartmut
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost- bounces@lists.boost.org] On Behalf Of troy d. straszheim Sent: Thursday, May 29, 2008 2:29 PM To: boost@lists.boost.org Subject: Re: [boost] [spirit] trunk: circular dependency parse <-> construct <-> assign_to (?)
Hey Hartmut,
I've got a workaround, like so:
If you forward declare the construct() overloads for the different primitive Attribute types, gcc seems to not greedily match this one (the current error):
template <typename Attribute, typename Iterator> inline void construct(Attribute& attr, Iterator const& first, Iterator const& last) { attr = Attribute(first, last); }
and instead to wait for this one (correct):
template <typename Iterator> inline void construct(unsigned int& attr, Iterator const& first, Iterator const& last) { Iterator first_ = first; parse(first_, last, uint_, attr); }
So I've got local mods of adding
#include <boost/spirit/home/qi/detail/construct_fwd.hpp>
to the top of assign_to.hpp, and the construct_fwd.hpp is attached.
I don't entirely get it, but I do like the looks of this:
troy@uranium:~/Projects/boost/trunk/libs/spirit/example/lex % gcc -o example4 example4.cpp -I . -I ../../../.. -lstdc++
troy@uranium:~/Projects/boost/trunk/libs/spirit/example/lex % ./example4 assignment statement to: a if expression: variable assignment statement to: b if expression: 2 assignment statement to: c assignment statement to: d if expression: x while expression: 10 assignment statement to: variable ------------------------- Parsing succeeded ------------------------- Bye... :-)
Best,
-t