shortcut for dynamic dispatch and operators
bearophile
bearophileHUGS at lycos.com
Tue Dec 1 09:07:48 PST 2009
KennyTM~:
> Make "x in y" returns a bool and works for arrays.
That's something more useful than the sum of usefulness of opDispatch, opPow and opLength. You use it all the time in code, and in D it's even more useful than in Python because in D a small linear scan can be very fast. To do that in my dlibs I use the function isIn(item, items), where items can be an AA too of course.
Bye,
bearophile
More information about the Digitalmars-d
mailing list