It\'s not a syntax I\'m familiar with, but I saw it in another question, an example being:
template<> struct Allowed { };
It is a template specialization. The typical case would be partial specialization:
#include
template struct foo
{
void doStuff() { std::cout << "generic foo "; }
};
template
struct foo
{
void doStuff() { std::cout << "specific foo with T2=int"; }
};
As you can see, the specialization removes one element from the template parameters and explicitly states a type instead of the removed one. That means if there is only one template type, the <>
just become empty:
template struct bar
{
void doStuff() { std::cout << "generic bar"; }
};
template<>
struct bar
{
void doStuff() { std::cout << "specific bar with T1=int"; }
};