How do I iterate through an AA sorted by key?

I am unable to .dup the aa.byKeyValue().

I have tried both
foreach(e; aa.byKeyValue().sort!"a.key < b.key")
{
    //... use e. key && e.value
}

and

foreach(k,v; aa.byKeyValue().sort!"a.key < b.key")
{

}

i get :
template std.algorithm.sorting.sort cannot deduce function from argument types !("a.key < b.key")(Result), candidates are: std/algorithm/sorting.d(875): std.algorithm.sorting.sort(alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable, Range)(Range r) if ((ss == SwapStrategy.unstable && (hasSwappableElements!Range || hasAssignableElements!Range) || ss != SwapStrategy.unstable && hasAssignableElements!Range) && isRandomAccessRange!Range && hasSlicing!Range && hasLength!Range)

any clues?

Reply via email to