summaryrefslogtreecommitdiff
path: root/boost/qvm/gen/vec_operations2.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/qvm/gen/vec_operations2.hpp')
-rw-r--r--boost/qvm/gen/vec_operations2.hpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/boost/qvm/gen/vec_operations2.hpp b/boost/qvm/gen/vec_operations2.hpp
index 715aec5bdd..00ee6d6eb5 100644
--- a/boost/qvm/gen/vec_operations2.hpp
+++ b/boost/qvm/gen/vec_operations2.hpp
@@ -192,6 +192,40 @@ boost
};
}
+ template <class A,class B>
+ BOOST_QVM_INLINE_OPERATIONS
+ typename lazy_enable_if_c<
+ is_scalar<A>::value && vec_traits<B>::dim==2,
+ deduce_vec<B> >::type
+ operator*( A a, B const & b )
+ {
+ typedef typename deduce_vec<B>::type R;
+ R r;
+ vec_traits<R>::template write_element<0>(r)=a*vec_traits<B>::template read_element<0>(b);
+ vec_traits<R>::template write_element<1>(r)=a*vec_traits<B>::template read_element<1>(b);
+ return r;
+ }
+
+ namespace
+ sfinae
+ {
+ using ::boost::qvm::operator*;
+ }
+
+ namespace
+ qvm_detail
+ {
+ template <int D>
+ struct mul_sv_defined;
+
+ template <>
+ struct
+ mul_sv_defined<2>
+ {
+ static bool const value=true;
+ };
+ }
+
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<