byKey and byValue: properties or methods?
Kapps
Kapps at NotValidEmail.com
Tue Jan 17 16:00:38 PST 2012
Is there even a point to having byKey/byValue?
Once UFCS comes in (and there's already a seemingly working pull request
for it), having .keys return a range like byKey/byValue should will be a
silent (though more efficient) change for most programs. And in the
situations where it's not (namely when you want to store it as an
array), just adding a .array at the end would work.
On 17/01/2012 12:48 AM, Andrei Alexandrescu wrote:
> I hate I must ask this:
>
> int[string] aa;
> foreach (k; aa.byKey) { ... }
>
> or
>
> int[string] aa;
> foreach (k; aa.byKey()) { ... }
>
>
>
> Thanks,
>
> Andrei "I told you" Alexandrescu
More information about the Digitalmars-d
mailing list