a general function pointer

B

blackbiscuit

Dear all,

Like void* in C++, it is a general pointer to any kind of data
structure. I wander whether there is a general function pointer, which
can be pointed to any kind of functions without the knowledge of their
signatures?

Thank you very much!

Best Wishes,
Tony
 
J

James Kanze

Like void* in C++, it is a general pointer to any kind of data
structure. I wander whether there is a general function
pointer, which can be pointed to any kind of functions without
the knowledge of their signatures?

Not officially. In practice, void (*)() is often used. In
fact, any pointer to function type will do the job. (Unlike
data pointers, all function pointers are more or less required
to have the same format.)
 
P

Pascal J. Bourguignon

James Kanze said:
Not officially. In practice, void (*)() is often used. In
fact, any pointer to function type will do the job. (Unlike
data pointers, all function pointers are more or less required
to have the same format.)

Well, not member function pointers. But then you can use boost::bind
or boost::lambda to wrap over them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,828
Latest member
LauraCastr

Latest Threads

Top