Re: [Boost-users] still stuck on expectation points
-----Original Message-----
From: philip tucker
On Fri, Apr 16, 2010 at 7:47 PM, philip tucker
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@lists.boost.org 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@lists.boost.org 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.
If I have understood your advice correctly, you suggest that this code should compile:
start %= (constitkind >> (id > (':' > (id >> probs)))) % ",";
It doesn't.
My post of 17Apr 02:24 contains an attachment with a compilable program. Thanks again.
On Tue, Apr 20, 2010 at 10:14 PM, philip tucker
If I have understood your advice correctly, you suggest that this code should compile:
start %= (constitkind >> (id > (':' > (id >> probs)))) % ",";
It doesn't.
My post of 17Apr 02:24 contains an attachment with a compilable program.
You might try sending it to the Spirit mailing list[1] then. I cannot really test at the moment, my programming computer is a bit dead, waiting for parts. [1] Official link: https://lists.sourceforge.net/lists/listinfo/spirit-general
participants (3)
-
Overmind DL1
-
OvermindDL1
-
philip tucker