ADL

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 3 05:25:11 PDT 2016


On 9/3/16 10:01 AM, Tobias Müller wrote:
> On Friday, 2 September 2016 at 23:51:35 UTC, Manu wrote:
>> This pattern seems to bite me every direction I turn when trying to
>> write range or algorithm style code. C++ has ADL, and ADL works. I've
>> never thought about this problem in C++, or had any problems with ADL.
>
> IMO the root of this problem is that templates are *duck typed*. All
> those problems wouldn't even exist with concepts/traits/typeclasses
> (done right).
> ADL is only an ugly hack.
>
> And with "Design by Introspection" it only gets worse: If an optional
> operation exists, but is not found because of unexpected problems like
> these, it still compiles but you only get limited functionality or bad
> performance.

What problems are you referring to? -- Andrei



More information about the Digitalmars-d mailing list