Tips for using template keywords
Note:
The delimiters include:,.,->
1. When the type name has the following properties, you should add the template prefix before the name:
1. the name appears in a template.
2. The name is restricted.
3. The name is not used to specify the list of base class inheritance, nor is it located in the initialization list of the member introducing the constructor.
4. The name depends on the template.
In addition, the prefix template can be used only when the three conditions on the current side are met at the same time. For example:
Template <typename T>
Struct s: x <t>: Base {
S (): x <t >:: base (typename x <t >:: base (0 )){}
X <t> F () {// The template cannot be used.
Template x <t>: C * P; // Statement of pointer P
X <t>: D * q; // Product
}
Typename x <int>: C * s; // optional because it does not comply with Article 4
};
Struct u {
X <int>: C * PC; // The template cannot be used because it is not used in the template, and U is not the template.
};
2. If a Template Name is a dependent name, you need to insert the template keyword before the name
For example:
template
class weird {
Public:
void casel (template shell :: template in :: template deep * P) {
}< BR >}