KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I could be totally wrong here, but as I understand it, C++ doesn't really have a native "pointer to member function" type. I know you can do tricks with Boost and mem_fun etc. But why did the designers of C++ decide not to have a 64-bit pointer containing a pointer to the function and a pointer to the object, for example? What I mean specifically is a pointer to a member function of a particular object of unknown type . I.E. something you can use for a callback . This would be a type which contains two values. The first value being a pointer to the function , and the second value being a pointer to the specific instance of the object. What I do not mean is a pointer to a general member function of a class. E.G. int (Fred::*)(char,float) It would have been so useful and made my life easier. Hugo
Tags (comma-separated)
Save Edits
Cancel