class E2, class F&gt;
    struct vector_scalar_binary_traits {
        typedef typename F::result_type result_type;
    };

    // inner_prod (v1, v2) = sum (v1 [i] * v2 [i])
    template&lt;class E1, class E2&gt;
    typename vector_scalar_binary_traits&lt;E1, E2, vector_inner_prod&lt;typename E1::value_type,
                                                                   typename E2::value_type,
                                                                   typename promote_traits&lt;typename E1::v