"Noel Belcourt"
On Oct 1, 2005, at 6:57 PM, David Abrahams wrote:
"Noel Belcourt"
writes: So if I want to perform an element-wise mpl::or operation of two sequences (r, p1) and then test the resulting sequence for equivalence to the input sequence, something like this should work since as you observe below, mpl::equal will compare two sequences and yield a scalar boolean.
BOOST_MPL_ASSERT((equal
>::type>)); One more observation about this, this code doesn't compile if r and p1 are a vector_c
or a vector_c with CW 9.5 on Tiger 10.4.2. The compiler output is attached. For example, if r and p1 are declared as follows, the code will not compile.
typedef vector_c
r,p1; BOOST_MPL_ASSERT(( equal >::type>)); The problem seems to be that the sequence produced by invoking transform using a boolean binary function is a different type than vector_c
.
I think that's not really the issue. I think the problem is that the _element_ types of those two sequuences are not identical.
The fix is trivial.
typedef vector_c
r,p1; BOOST_MPL_ASSERT(( equal >::type, transform >::type>)); While clunky, this works, and also works if we declare r and p1 as vector_c
.
Actually I think that's technically nonportable.
I'm guessing the right thing to do is use find, one way or the other.
This is
typedef transform
Just want to be sure that this is known and expected behavior?
I'm actually unsure. Aleksey?
BOOST_MPL_ASSERT(( equal_to<
I think this should be is_same. Sorry for the mistake.
find< zip_view
, not_equal_to ,or_ ,second<_> > ::type , end
>::type ))
I'll be sure to read up on zip_view and try this out.
Thanks for your help.
-- Noel
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Dave Abrahams Boost Consulting www.boost-consulting.com