DMD 1.019 and 2.003 releases

Christian Kamm kamm.incasoftware at shift-at-left-and-remove-this.de
Mon Jul 23 09:08:47 PDT 2007


> Cool, but it would be better to implement double dispatch than the Visitor
> pattern.  It is ultimately more efficient and more flexible.

It is simple to implement multiple dispatch using the same method as for the
single dispatch example. The overhead is the same: two virtual function
calls and some ifs doing address comparisons.

Might get less efficient or more complicated if you want to call the closest
match instead of raising an error if there's no exact match.

Christian



More information about the Digitalmars-d-announce mailing list