how to iterate over an AA by key-value pair (tuple)?

Timothee Cour thelastmammoth at gmail.com
Thu Feb 13 16:05:38 PST 2014


is there anything more efficient than this?

auto byKeyValue(T)(T a)if(isAssociativeArray!T){
  return a.byKey.map!(b=>tuple(b, a[b]));
}



On Thu, Feb 13, 2014 at 3:56 PM, Timothee Cour <thelastmammoth at gmail.com>wrote:

> how to iterate over an AA by key-value pair (tuple)?
> use case:
> avoid interrupting UFCS chains, eg:
> foo.generate_aa.byKeyValue.filter!(a=>a[0].isLower).map!(a=>a[1]) ...
> of course I could roll my own function but I was wondering if there's
> already a way.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20140213/ba56fe77/attachment-0001.html>


More information about the Digitalmars-d-learn mailing list