On 2008-11-09 09:04:00 -0500, Christopher Wright <[EMAIL PROTECTED]> said:
Michel Fortin wrote:
On 2008-11-07 02:42:20 -0500, Walter Bright <[EMAIL PROTECTED]> said:
The difference between D delegates and boost::bind for member functions
is that D delegates bind to the specific virtual function when the
delegate is created, while boost::bind binds when the delegate is
called. The former is, of course, more efficient when the delegate gets
called more than once.
But the later makes it possible to call the same member function on
various object instances (which may resolve to different code for
virtual functions). I find that capability lacking in D.
You can do it in D, but only with templates. And it's ugly.
I must admit, I've never encountered a situation in which I wanted a
pointer to a member function. What situations did you encounter this
in? Why were, say, interfaces insufficient?
In the D/Objective-C bridge when I recieve a call from the Objective-C
side and I need to dispatch it to the corresponding method of the given
D object.
--
Michel Fortin
[EMAIL PROTECTED]
http://michelf.com/