00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef MTL_VEC_VEC_PLUS_EXPR_INCLUDE
00016 #define MTL_VEC_VEC_PLUS_EXPR_INCLUDE
00017
00018 #include <boost/static_assert.hpp>
00019
00020 #include <boost/numeric/mtl/vector/vec_vec_pmop_expr.hpp>
00021 #include <boost/numeric/mtl/utility/ashape.hpp>
00022 #include <boost/numeric/mtl/operation/sfunctor.hpp>
00023
00024 namespace mtl { namespace vector {
00025
00026 template <typename E1, typename E2>
00027 inline vec_vec_pmop_expr< E1, E2, mtl::sfunctor::plus<typename E1::value_type, typename E2::value_type> >
00028 operator+ (const vec_expr<E1>& e1, const vec_expr<E2>& e2)
00029 {
00030
00031 BOOST_STATIC_ASSERT((boost::is_same<typename ashape::ashape<E1>::type,
00032 typename ashape::ashape<E2>::type>::value));
00033 typedef vec_vec_pmop_expr< E1, E2, mtl::sfunctor::plus<typename E1::value_type, typename E2::value_type> > type;
00034 return type(static_cast<const E1&>(e1), static_cast<const E2&>(e2));
00035 }
00036
00037 } }
00038
00039 #endif
00040