1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
In section ref(DISTINGUISH) a special application of the keyword ti(typename)
was discussed. There we learned that it is not only used to define a name for
a (complex) type, but also to distinguish types defined by class templates
from members defined by class templates. In this section two more
applications of tt(typename) are introduced:
itemization(
it() In section ref(RETURNNESTED) we apply tt(typename) to situations
where types nested in templates are returned from member functions of class
templates;
it() in section ref(TYPERES) we cover the problem of how to refer to base
class templates from derived class templates.
)
In addition to the special applications of tt(typename) section
ref(DOTTEMP) introduces some new syntax that is related to the extended use of
the keyword tt(typename): tt(::template, .template) and tt(->template) are
used to inform the compiler that a name used inside a template is itself a
class template.
|