现在我们只需要向mpl::transform传递一个用于对单位进行乘除法(通过对两个序列的对应元素相加减)的binaryoperation。如果你查看mpl的参考手册,你会看到plus和minus两个元函数刚好可以满足要求:
#include <boost/static_assert.hpp>
#include <boost/mpl/plus.hpp>
#include <boost/mpl/int.hpp>
namespace mpl = boost::mpl;
boost_static_assert((
mpl::plus<
mpl::int_<2>
, mpl::int_<3>
>::type::value == 5
));