
29 Sep
2005
29 Sep
'05
6:18 p.m.
Noel Belcourt wrote:
Hi,
I'm new to the list so this may have been answered elsewhere (like a FAQ for MPL) but I couldn't find it.
I've got 2 vector_c types like this
typedef vector_c<int, 1,2,1,1,-2,0,1> p1; typedef vector_c<int, 0,3,0,-1,1,3,5> p2;
and a resultant type defined as
typedef vector_c<int, 1,1,0,1,1,0,1> r;
that I want to compare at compile time using logic like this
r = p1 || p1 && p2
I don't get it: wouldn't p1 match everything that p1 && p2 matches? Did you mean r == p1 || p1 && p2? You might try something like: transform<p1, p2, or_<_1, and_<_1, _2> > >; if not. Otherwise, try: equal< r, transform<p1, p2, or_<_1, and_<_1, _2> > >::type >; I don't use MPL, though, so that probbably doesn't work. <snip>