David Abrahams writes:
"Noel Belcourt"
writes: 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.
Yep. The default predicate for 'equal' is 'is_same', which means that
the algorithm compares elements' type identity instead of their values
(and for the numeric operations, the former is seldom guaranteed). Try
typedef vector_c
Just want to be sure that this is known and expected behavior?
I'm actually unsure. Aleksey?
Yes, it is. -- Aleksey Gurtovoy MetaCommunications Engineering