c++.beta - referencing nested templates
-
Richard Grant
(19/19)
Jan 24 2003
We talked about his one before. This fails due to the "typename A
::te... - Walter (7/26) Jan 24 2003 You can work around it for now by simply replacing ::template with ::.
- Richard Grant (13/19) Mar 16 2003 Ok, member template keyword ala A::template B<> works in fine. But inher...
We talked about his one before. This fails due to the "typename A<T>::template", and works with "typename A<T>::" syntax. template<class T> struct A { template<class U> struct B { typedef int type; }; }; template<class T> struct C { typedef typename A<T>::template B<int>::type type; // Error: identifier expected }; void main() { C<int> c; } The iterator adaptor lib and lower level libs that it depends on favor nested template references. There is a directive that attempts to work around this problem, but it is *not* implemented in this lib hierarchy. Fixing this would allow unpatched compilation of iterator adaptor lib. Richard
Jan 24 2003
You can work around it for now by simply replacing ::template with ::. "Richard Grant" <fractal clark.net> wrote in message news:b0r6mi$tj0$1 digitaldaemon.com...We talked about his one before. This fails due to the "typenameA<T>::template",and works with "typename A<T>::" syntax. template<class T> struct A { template<class U> struct B { typedef int type; }; }; template<class T> struct C { typedef typename A<T>::template B<int>::type type; // Error: identifier expected }; void main() { C<int> c; } The iterator adaptor lib and lower level libs that it depends on favornestedtemplate references. There is a directive that attempts to work aroundthisproblem, but it is *not* implemented in this lib hierarchy. Fixing thiswouldallow unpatched compilation of iterator adaptor lib. Richard
Jan 24 2003
In article <b0s89v$1elh$1 digitaldaemon.com>, Walter says...You can work around it for now by simply replacing ::template with ::. "Richard Grant" <fractal clark.net> wrote in message news:b0r6mi$tj0$1 digitaldaemon.com...Ok, member template keyword ala A::template B<> works in fine. But inheritance using this sytax fails to compile: struct B { template <class T> struct C { }; }; template <class T> struct A : B::template C<T> { }; //Error: identifier or '( declarator )' expected int main() { A<int> a; } RichardWe talked about his one before. This fails due to the "typenameA<T>::template",and works with "typename A<T>::" syntax.
Mar 16 2003