This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/mpl/vector_c.hpp> | |
#include <boost/mpl/plus.hpp> | |
#include <boost/mpl/transform.hpp> | |
#include <boost/mpl/equal.hpp> | |
#include <boost/static_assert.hpp> | |
typedef boost::mpl::vector_c<int,1,2,3> v_a; | |
typedef boost::mpl::vector_c<int,1,1,1> v_b; | |
typedef boost::mpl::vector_c<int,2,3,4> v_c0; | |
struct plus_f | |
{ | |
template <class T1, class T2> | |
struct apply | |
{ | |
typedef typename boost::mpl::plus<T1,T2>::type type; | |
}; | |
}; | |
typedef typename boost::mpl::transform<v_a,v_b,plus_f>::type v_c1; | |
BOOST_STATIC_ASSERT(( | |
boost::mpl::equal<v_c0,v_c1>::type::value | |
)); | |
int main() | |
{ | |
return 0; | |
} |
No comments:
Post a Comment