Boost logo

Boost Users :

From: Lemings, Eric B. \(Contr\) (Eric.Lemings_at_[hidden])
Date: 2005-03-31 18:48:14


I just wrote a quick and dirty test.

        #include <boost/mpl/vector_c.hpp>
        namespace mpl = boost::mpl;

        typedef mpl::vector_c< int, 1,8,0,-2,4 > t1;
        typedef mpl::vector_c< int, 7,-3,8,0 > t2;
        // Causes compile error: Passes mpl::void_ type to mpl::plus.
        //typedef mpl::transform< t1, t2, mpl::plus< _1, _2 > > r;

        namespace my {
          template < typename T1, typename T2 >
          struct plus: mpl::plus< T1, T2 > { };

          template < >
          struct plus< mpl::void_, T > {
            typedef T type;
          };

          template < >
          struct plus< T, mpl::void_ > {
            typedef T type;
          };
        }

        typedef mpl::transform< t1, t2, my::plus< _1, _2 > > r;

Got the following compile error:

        The class "boost::mpl::vector5<mpl_::integral_c<int, 7>, ...,
        mpl_::integral_c<int,0>>" has no member "item5".

For what it's worth.

Eric.

> -----Original Message-----
> From: Lemings, Eric B. (Contr)
> Sent: Thursday, March 31, 2005 4:10 PM
> To: 'boost-users_at_[hidden]'
> Subject: boost::mpl::transform
>
>
>
> What is the result type of transform if the algorithm is
> given two sequences of different sizes?
>
> Thanks,
> Eric.
>


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