Is there any way to avoid the dummy functions in the following example?
template<class T1, class T2>
struct A {
static T1 T1_ ();
static T2 T2_ ();
typedef decltype (T1_ () + T2_ ()) sum_type;
};
I would like to write
typedef decltype (T1+T2) sum_type;
but that's not possible since T1 and T2 are types, not variables. Is my above solution really the easiest one possible?
typedef decltype(*(T1*)0 + *(T2*)0) sum_type;avoids the functions.