#include <boost/static_assert.hpp> #include <boost/mpl/equal.hpp> #include <boost/mpl/vector_c.hpp> #include <boost/mpl/transform.hpp> #include <boost/mpl/multiplies.hpp> #include <boost/mpl/placeholders.hpp>
int main() { namespace mpl = boost::mpl; using namespace mpl::placeholders;
typedef mpl::vector_c<int, 1, 2, 3> v1; typedef mpl::transform<v1, mpl::multiplies<_1, _1> >::type v2; typedef mpl::vector_c<int, 1, 4, 9> expected;
BOOST_STATIC_ASSERT((mpl::equal<expected, v2>::type::value));
return 0; }