I can't see in your code, when T is getting resolved. (that is, when it gets to be a specific type).
This might also be the problem GCC has.