If I have a template class with a default template type, I have to write the template angle brackets. Is it somehow possible to avoid this?
Example:
... if I want to use the class ...
This is a common source of confusion. A class template is not a class, but a template from which classes are generated. The angle brackets is what tells the compiler that you want to generate a class out of the class template with the given template arguments, without the angle brackets what you have is a template.
template
struct TemplateClass {...};
template >
void f() {
T t; ...
}
template
void g() {
T t; ...
}
f(); // Accepts a template with a single type argument
g >(); // Accepts a type, that can be generated out of the template
The language does not allow the coexistence of a template and a type with the same name in the same namespace, so the answer is that it cannot be done. You can create a type alias but you will have to give it a different name.