February 14, 2014 Re: how to iterate over an AA by key-value pair (tuple)? | ||||
---|---|---|---|---|
| ||||
Attachments:
| 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@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. > > |
Copyright © 1999-2021 by the D Language Foundation