N
Newsgroup - Ann
I have the following code:
class nn_base {
public:
double phi(double v)
{
return v;
};
double ComputeY(int i, int j, double (nn_base::*activeFunc)(double))
{
return (this->*activeFunc)(1.0);
}
};
main()
{
nn_base nn1;
double x = nn1.ComputeY(1, 2, nn_base:hi);
return 0;
}
It can be compiled by Visual C++ both 6.0 and .NET but cannot by gcc 3.22,
which complains:
test7.cpp: In function `int main()':
test7.cpp:18: no matching function for call to `nn_base::ComputeY(int, int,
<unknown type>)'
test7.cpp:10: candidates are: double nn_base::ComputeY(int, int, double
(nn_base::*)(double))
what's wrong with that?
class nn_base {
public:
double phi(double v)
{
return v;
};
double ComputeY(int i, int j, double (nn_base::*activeFunc)(double))
{
return (this->*activeFunc)(1.0);
}
};
main()
{
nn_base nn1;
double x = nn1.ComputeY(1, 2, nn_base:hi);
return 0;
}
It can be compiled by Visual C++ both 6.0 and .NET but cannot by gcc 3.22,
which complains:
test7.cpp: In function `int main()':
test7.cpp:18: no matching function for call to `nn_base::ComputeY(int, int,
<unknown type>)'
test7.cpp:10: candidates are: double nn_base::ComputeY(int, int, double
(nn_base::*)(double))
what's wrong with that?