Re: [Spirit Development][Karma] statement [_0 = _val] is broken in trunk

"Hartmut Kaiser" <[email protected]> Sun, 2 Jan 2011 10:43:16 -0600
Newsgroups gmane.comp.parsers.spirit.devel
Message-ID <[email protected]>
> I am trying to use the following rule with [_0 = _val] at the end.  It
> compiles fine, but executes improperly.
> 
> rule<iter,point()> broken_rule = (int_ << ',' << int_)[_0 = _val];
> 
> A very similar rule, however, works just fine.
> 
> rule<iter,point()> working_rule = (int_ << ',' << int_);
> 
> The relevant part of the code is:
>   point data(1,2);
>   rule<iter,point()> broken_rule = (int_ << ',' << int_)[_0 = _val];
>   std::string broken_output;
>   generate(std::back_inserter(broken_output),broken_rule,data);
> 
> 
> The semantic action appears to break it.
> The output of my program is:
> 
> expected output: 1,2
> broken   output: 0,0
> working  output: 1,2
> 
> Apparently [_0 = _val] discards _val and default constructs _0 to [0,0].

I'll look into this as soon as I'm back from vacation next week.

Thanks!
Regards Hartmut
---------------
http://boost-spirit.com




------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl