P
persres
Hi,
I am using visual studio 2008.
I have the following code:
typedef int *PINT;
template<class T>
void foo(const T src)
{
}
template<>
void foo<int *> (const int * src)
{
} // line 43
int main()
{
int a;
foo(&a);
}
file.cpp (43) :error C2912: explicit specialization; 'void
foo<int*>(const int *)' is not a specialization of a function
template.
If I were to replace int * with PINT, it compiles.
Any explanations please.
I am using visual studio 2008.
I have the following code:
typedef int *PINT;
template<class T>
void foo(const T src)
{
}
template<>
void foo<int *> (const int * src)
{
} // line 43
int main()
{
int a;
foo(&a);
}
file.cpp (43) :error C2912: explicit specialization; 'void
foo<int*>(const int *)' is not a specialization of a function
template.
If I were to replace int * with PINT, it compiles.
Any explanations please.