Thanks Eric for your fast answer!
Unfortunately, this doesn't solve my problem. To make a very very long discussion long, here a small
example showing the problem from another side:
I have an expression wrapper called mp_terminal and I define terminals, but not in the documented
way (which I suspect is the problem) but instead deriving from them (for convenience purposes), for example:
struct True : mp_terminal::type>
{...}
These terminals are used with a simple grammar:
struct BuildGuards
: proto::or_<
proto::when<
proto::logical_or,
GuardOR()
>,
proto::when<
proto::logical_and,
GuardAND()
>,
proto::when<
proto::logical_not<BuildGuards >,
GuardNOT()
>,
proto::when <
proto::terminal,
proto::_()
{};
Then, expressions like:
True()|| False() give the expected result (struct GuardOR).
Even True()&& (Dummy1() || !(False() || True())) give the expected result:
struct GuardAND > > >
But a "!" alone (meaning followed by just a terminal, not the other parts of the BuildGuards grammar) breaks all (as do all unary operators I tried), like !False() or True()|| !False().
!False() =>
struct GuardNOT > >
Notice that !(False() || True()) works!
Now, if I do not derive from mp_terminal but instead proceed as documented, all works as expected:
proto::terminal<True>::type True_;
...
!False_ => correct result.
Sadly, this documented usage is unpractical in my use case.
So, supposing that I managed this easy grammar, I imagine that the usage I do of terminals (deriving from them) is not allowed.
Then, why do most use cases work like a charm? Only unary operators seem to fail.
Attached are 2 test files. V1 doesn't work in all cases while V2 does.
I use 1.38.
Thanks a lot!
Christophe
_________________________________________________________________
Windows Live™: Keep your life in sync. Check it out!
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009