1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
template<class T, class U> struct UnaryReturn { typedef T Type_t; }; struct foo { template <class T> typename UnaryReturn<T, int>::Type_t bar(); }; template<class T> struct UnaryReturn<T, int> { typedef bool Type_t; };