Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2006-02-23 23:41:16


Lucio Flores <dogboy_l_at_[hidden]> writes:

> Just trying to use mpl::transform on a vector of int's and I can't seem to get
> it working properly. Can anyone see what's wrong?? I'm trying to perform
>
> vector_c<int, 1, 2, 3> + vector_c<int, 1, 1, 1> = vector_c<int, 2, 3 ,4>
>
> The is_same function always returns false when I compile and run it.

The result of the transform is only required to be "concept-identical"
to the result you're looking for.

  http://www.boost.org/libs/mpl/doc/refmanual/terminology.html

So you almost never want to use is_same to compare sequences. usually
the equal algorithm is a more appropriate choice:

  http://www.boost.org/libs/mpl/doc/refmanual/equal.html

P.S. <plug> I recommend http://www.boost-consulting.com/mplbook for MPL
            newbies
     </plug>

HTH,

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net