Hello,
This is my current solution but there must be a better way to do it in D
T get(T)(T[] arr, size_t idx, T def = T.init){
return idx<arr.length ? arr[idx]
: def;
}
.......
Preset[string] presets;
presets.keys.sort.take(1).get(0); <-----
Is there a prettier way to do this?
Thanks in advance.