Lines Matching full:template
3 /** \page TopicTemplateKeyword The template and typename keywords in C++
5 There are two uses for the \c template and \c typename keywords in C++. One of them is fairly well known
7 to a template function or a type. This regularly trips up programmers that use the %Eigen library, often
13 \section TopicTemplateKeywordToDefineTemplates Using the template and typename keywords to define templates
15 The \c template and \c typename keywords are routinely used to define templates. This is not the topic of this
17 should illustrate this use of the \c template keyword.
20 template <typename T>
27 We could just as well have written <tt>template <class T></tt>; the keywords \c typename and \c class have the
31 \section TopicTemplateKeywordExample An example showing the second use of the template keyword
33 Let us illustrate the second use of the \c template keyword with an example. Suppose we want to write a
65 the \c template keyword in C++. Even though it may look strange, the \c template keywords are necessary
72 The reason that the \c template keyword is necessary in the last example has to do with the rules for how
74 point where the template is defined, without knowing the actual value of the template arguments (\c Derived1
76 a member template and that the following < symbol is part of the delimiter for the template
79 possibility, according to the standard. If <tt>dst.triangularPart</tt> is a member template (as in our case),
80 the programmer should specify this explicitly with the \c template keyword and write <tt>dst.template
84 - A <em>dependent name</em> is name that depends (directly or indirectly) on a template parameter. In the
86 on the template parameter \c Derived1.
88 dependent name and \c yyy refers to a member template, then the \c template keyword must be used before
89 \c yyy, leading to <tt>xxx.template yyy</tt> or <tt>xxx->template yyy</tt>.
106 If \c SparseMatrixType depends on a template parameter, then the \c typename keyword is required:
109 template <typename T>
124 - The book "C++ Template Metaprogramming" by David Abrahams and Aleksey Gurtovoy contains a very good
125 explanation in Appendix B ("The typename and template Keywords") which formed the basis for this page.