Boost logo

Boost :

From: troy d. straszheim (troy_at_[hidden])
Date: 2008-05-29 15:28:45


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_at_uranium:~/Projects/boost/trunk/libs/spirit/example/lex
% gcc -o example4 example4.cpp -I . -I ../../../.. -lstdc++

troy_at_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




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk