#include <iostream>
using namespace std;
template <unsigned int N, typename Hurf>
class Foo
{
public:
void function();
};
template <unsigned int N, typename Hurf>
void Foo<N, Hurf>::function()
{
cout << "generic: " << N << endl;
}
template <typename Hurf>
void Foo<9, Hurf>::function()
{
cout << "this doesnt compile :(" << endl;
}
int main(int argc, char** argv)
{
Foo<3, int> foo1;
Foo<9, int> foo2;
foo1.function();
foo2.function();
return 0;
} |