shortcut for dynamic dispatch and operators

Bill Baxter wbaxter at gmail.com
Tue Dec 1 12:23:29 PST 2009


On Tue, Dec 1, 2009 at 12:23 PM, Bill Baxter <wbaxter at gmail.com> wrote:
> On Tue, Dec 1, 2009 at 12:15 PM, Pelle Månsson <pelle.mansson at gmail.com> wrote:
>>> It's a bit difficult to see a very thin operator mask a linear operation,
>>> but I'm thinking maybe "x in y" could be defined if y is a compile-time
>>> array. In that case, the compiler knows the operation and the operand so it
>>> may decide to change representation as it finds fit.
>>>
>>> Andrei
>>
>> What do you suggest using when you need to find out if an object is in an
>> array? Arrays lacking opIn bothers me.
>
> I'm guessing Andrei would recommend std.range.find.

er... std.algorithm.find, I mean.

--bb



More information about the Digitalmars-d mailing list