------- Comment #5 from brakiozor at caramail dot com 2007-10-19 10:06 ------- yes, one of the way is to pass by an intermediate template type... (I found it on the web) but the compiler error could(and should) be fixed
#define TPL_TYPEOF_MUL(A,B) typename typeof_mul<A,B>::type #define TYPEOF_MUL(A,B) typeof_mul<A,B>::type template <typename A, typename B> struct typeof_mul { typedef typeof(A()*B()) type; }; template <class Tx, class Ty> Y<TPL_TYPEOF_MUL(Tx,Ty)> operator *(X<Tx>& x, const Ty& y) { Y<TPL_TYPEOF_MUL(Tx,Ty)> res(x); //res *= y; return res; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33808