Article ID: 166282
Article Last Modified on 7/5/2005
170365 INFO: Visual Studio 97 Service Packs - What, Where, and Why
/*
* Compiler Options: None
*/
template <class T> T* func(const T*p)
{
return 0;
}
int main()
{
const int *i=0;
int*j = func(i); // erroneous C2440 here
return 0 ;
}
The following sample code demonstrates the workaround for Visual C++ 5.0.
/*
* Compiler Options: None
*/
template <class T> T* func(const T*p)
{
return 0;
}
int main()
{
const int *i=0;
int*j = func<int>(i);
return 0 ;
}
Additional query words: CL
Keywords: kbbug kbfix kblangcpp kbvs97sp1fix kbprogramming kbcpponly kbcode kbcompiler KB166282