2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-22 03:42:19 +00:00

added an experimental promote_type_multiplies

svn path=/trunk/boost/boost/numeric/ublas/; revision=24250
This commit is contained in:
Michael Stevens
2004-08-02 19:37:24 +00:00
parent 400e00e4e5
commit a060e77f10

View File

@@ -963,6 +963,24 @@ namespace boost { namespace numeric { namespace ublas {
typename base_type::types, index>::type id;
typedef typename id::type promote_type;
};
template<class X, class Y>
struct promote_type_multiplies {
typedef type_deduction_detail::base_result_of<X, Y> base_type;
static typename base_type::x_type x;
static typename base_type::y_type y;
BOOST_STATIC_CONSTANT(int,
size = sizeof(
type_deduction_detail::test<
typename base_type::x_type
, typename base_type::y_type
>(x * y) // Specifically the * arithmetic actions
));
BOOST_STATIC_CONSTANT(int, index = (size / sizeof(char)) - 1);
typedef typename mpl::at_c<
typename base_type::types, index>::type id;
typedef typename id::type promote_type;
};
#else