L
Lionel B
Greetings,
I cannot figure out why the following code does not compile:
--- BEGIN CODE ---
typedef double ftype(double);
struct A
{
double x;
template<ftype F>
double eval()
{
return F(x);
}
};
template<ftype F>
struct B
{
A a;
double foo()
{
return a.eval<F>();
}
};
--- END CODE ---
It generates the error message:
scratch.cpp: In member function `double B<F>::foo()':
scratch.cpp:23: error: parse error before `;' token
[ line 23 being return a.eval<F>(); ]
Compiler gcc (GCC) 3.3.3 (cygwin special) on Win2K
Any help appreciated,
I cannot figure out why the following code does not compile:
--- BEGIN CODE ---
typedef double ftype(double);
struct A
{
double x;
template<ftype F>
double eval()
{
return F(x);
}
};
template<ftype F>
struct B
{
A a;
double foo()
{
return a.eval<F>();
}
};
--- END CODE ---
It generates the error message:
scratch.cpp: In member function `double B<F>::foo()':
scratch.cpp:23: error: parse error before `;' token
[ line 23 being return a.eval<F>(); ]
Compiler gcc (GCC) 3.3.3 (cygwin special) on Win2K
Any help appreciated,