Boost logo

Boost Users :

Subject: Re: [Boost-users] still stuck on expectation points
From: Overmind DL1 (overminddl1_at_[hidden])
Date: 2010-04-20 20:54:45


-----Original Message-----
From: philip tucker <phhht_at_[hidden]>
Sent: Tuesday, April 20, 2010 4:44 PM
To: boost-users_at_[hidden] <boost-users_at_[hidden]>
Subject: Re: [Boost-users] still stuck on expectation points

On 16 Apr 2010, at 6:52 PM, OvermindDL1 wrote:

> On Fri, Apr 16, 2010 at 7:47 PM, philip tucker
> <phhht_at_[hidden]> wrote:
>
>>
>> On 16 Apr 2010, at 6:16 PM, OvermindDL1 wrote:
>>
>>
>>>
>>> start %= (constitkind >> (id > ':' > id) >> probs) % ",";
>>>
>>>
>>
>> Thanks, but I already tried it. Doesn't compile.
>>
>
> Er, if you re-read my post I was saying *not* to do that, because that
> will not work, that is actually what the compiler is doing because of
> operator precedence. You should memorize the precedence rules for
> C++, *especially* if you are going to be dealing with heavily
> templated operator libraries like Spirit.
> http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B
>
> Because you are mixing right-shifts (>>) and greater-than's (>), the
> precedence causes them to collapse in different ways, which is why you
> need the parenthesis like this:
> start %= (constitkind >> (id > (':' > (id >> probs)))) % ",";
>
> Again, learn the C++ operator precedence rules and all this will make
> easy sense. :)
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users

If I have understood your advice correctly,
you suggest that this code should compile:
> start %= (constitkind >> (id > (':' > (id >> probs)))) % ",";

It doesn't.
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users

____________________________________________________________
Sorry for the bad way to respond, on phone with outlook mobile.

Do you have a complete compilable example that demonstrates your
problem? Also, try asking on the Spirit mailing list.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net