Koenig lookup in D?

Walter Bright newshound2 at digitalmars.com
Tue Aug 27 00:54:08 PDT 2013


On 8/27/2013 12:45 AM, monarch_dodra wrote:
> The root reason for this mechanism, is that it allows writing
> templated functions that can operate on objects from any
> namespace.

I believe the root reason was so that operator overloads would work when the 
rvalue was the class type. (In C++ you have to write non-member functions to 
handle those cases.)

D solves that via other mechanisms, so Koenig lookup is not necessary.



More information about the Digitalmars-d mailing list