I'm having a compile time problem with g++ 3.2.something, which I can
boil down to this:
struct A {
template<int N> void foo(){}
};
template<class T>
void fn( int & ) {
A a;
a.foo<0>(); //compiler reports "syntax error before semicolon"
}
main()
{
A a;
a.foo<0>();
}
Note that the template function is not being instantiated - the error
arises from the function definition. It appears that the compiler is
confused about just what foo is.
But using it in main() gives me no problem - the compiler is well aware
at that point that foo<N> is a function.
There are a couple of workarounds that coerce everything into
compiling, but in my real code things are a little hairier and I
haven't been able to get them to work. I guess what I am hoping to find
out first is what I am doing wrong. Anything obvious?
|
| markn at ieee dot org
|