What does this syntax mean?
ForExample<Something>();
Can someone explain with a few examples how and what for it can be used?
What does this syntax mean?
ForExample<Something>();
Can someone explain with a few examples how and what for it can be used?
This code could be a call of the template function or instantiation of temporary class object. For example, function is defined as:
template <typename T>
void ForExample(){
// Do something
}
This function can be called as:
ForExample<int>();
In your case type Something can be any type (int, double, string, float ...)
Or we can define template class:
template <typename T>
class ForExample {
// something
};
Temporary object can be created as:
ForExample<int>();