Topic: Template name equivalence
Author: "Igor A. Goussarov" <igusarov@akella.com>
Date: Thu, 21 Jun 2001 23:19:40 GMT Raw View
The following code works just fine:
template <typename T > struct Base {};
struct Derived : public Base<Derived > {};
Now let's make Derived type a template itself:
template <template <typename T1 > class Der > struct Base {};
template <typename T2 > struct Derived : public Base< Derived > {};
^^^^^^^^^^^^^^^
According to 14.6.1:1 should the compiler treat the underlined part
as
Base< Derived<T2> > and therefore refuse to match it to the given Base
template since it is no longer a template template parameter but instead
an ordinary class?
Can this clause be applied here? Should I follow it and use a
qualified template name like Base< ::Derived >?
Igor
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]