<div dir="ltr">is there anything more efficient than this?<div><br><div><div>auto byKeyValue(T)(T a)if(isAssociativeArray!T){</div><div> return a.byKey.map!(b=>tuple(b, a[b]));</div><div>}</div></div><div><br></div></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 13, 2014 at 3:56 PM, Timothee Cour <span dir="ltr"><<a href="mailto:thelastmammoth@gmail.com" target="_blank">thelastmammoth@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">how to iterate over an AA by key-value pair (tuple)?<br><div>use case:</div><div>avoid interrupting UFCS chains, eg:</div>
<div>foo.generate_aa.byKeyValue.filter!(a=>a[0].isLower).map!(a=>a[1]) ...<br></div>
<div>of course I could roll my own function but I was wondering if there's already a way.</div><div><br></div></div>
</blockquote></div><br></div>