linarin wrote:
Quote:
How could I make this templates to work:
>
template<typename F,F f //here f is non type template parameter
bool MethodProxy(int a,int b){ //could'nt change this function
return type and arguments.
There seems to be no use of 'F' or 'f' anywhere in this function. Are
you sure you need them?
Quote:
return true;
}
>
template<typename F //here F is a type of function object
void Def(F f){
static MyStruct global_methods[] =
What's 'MyStruct'?
Quote:
{
{ "alert", JsProxyMethod<F,f}, // error occur at here
NULL
} ;
//here do more works.
}
>
int alert(int a){
return 0;
}
>
int main(int argc,char* argv[]){
Def(alert); //when this function invoked, alert will be
executed.
return 0;
}
>
>
>
the error message is :
compiler complains that "f" not a valid argument and JsProxyMethod is
not a external linkage function.
I am not sure it's possible to help you without seeing _real_ code
that produces that error message.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask