
6 Dec
2012
6 Dec
'12
11:13 p.m.
Jeffrey Lee Hellrung, Jr. wrote:
T is not in a deduced context, i.e., the compiler cannot deduce what T is. You can try it yourself if you don't believe me :)
I confess I still don't get it. Seems to me to be a special instance of partial template specialization. Anyway The following example works on both MSVC 9.0 and GCC 4.5.3 template<class T> struct trait { }; template<> struct trait<int> { }; template<class T> struct outer { struct inner { }; }; template<class T> struct indirect : public outer<T>::inner { }; template<class U> struct trait< indirect<U> > { }; without the indirect it did indeed fail on both compilers. I would seem to me that a variation on the above above could be adapted to give the original poster