templateとtypeof
以下のように書くとコンパイルエラー
template
typeof(*(T*)0+*(U*)0) add(const T& x, const U& y) { return x+y; }
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11078
回避策
template
struct C
{
typedef typeof(*(T*)0+*(U*)0) type;
};template
typename C::type add(const T& x, const U& y) { return x+y; }