Can I devise function pointer type from function name by using
template programming?
e.g.
I have function:
exertn “C” void xmlFreeDoc(xmlDocPtr cur);
I want something like following:
typeof(xmlFreeDoc) functionpointer = xmlFreeDoc;
i.e value to type conversion
I want pass this type to Holder which will call this function in dtor.
Currently I am using following code to do the same task:
extern "C" {
typedef void (*funcPtr)(void*) ;
}
Holder<xmlChar, funcPtr, falseval(xmlNodeListGetString(doc, cur_node-
>children, 1), xmlFree);Issues with above code:
I need to add every type of function in the extern “C” block.
Thanks,
Nitin.