I just wrote a quick and dirty test.
#include
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>" 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@lists.boost.org'
Subject: boost::mpl::transform
What is the result type of transform if the algorithm is
given two sequences of different sizes?
Thanks,
Eric.