On 2013-06-10 09:23, Manu wrote:It depends on how you look at it. In D a delegate is a function pointer with a context pointer. In C++ a pointer to a member function is basically the same, the context pointer is just passed separately.
That seems pretty awkward to me. Basically a hack.
A function pointer is not a delegate, so I don't see why that should be
used to describe one.
To do what? As far as I know C++ doesn't have anything corresponding to a D delegate.Also, extern(C++) delegates are useful too in their own right
Actually I don't see why you can't use a delegate for this. The only difference is that it won't be virtual.I haven't needed to yet... but that doesn't mean it might not be useful.
It would probably be used in D for tight binding with other systems.
AngelScript binds to native code with member function pointers... just
off the top of my head.