I have following code:
template<int FORMAT>
int double_to_bulk(double value,
char* buf,
double max_num,
int* state = NULL)
{
if (isnan(value))
{
//Something to do
return 1;
}
//Something more to do
}
And strange compilation error:
myfile.h: In function ‘int double_to_bulk(double, char*, double, int*)’:
myfile.h:351: error: there are no arguments to ‘isnan’ that depend on a template parameter, so a declaration of ‘isnan’ must be available
myfile.h:351: error: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
But I really don't want to use -fpermissive
I use gcc 4.1.2
, quite old, but nothing to do with it. Why is it problem to use isnan
in template function?