https://issues.dlang.org/show_bug.cgi?id=20617
Andrej Mitrovic <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|phobos |druntime --- Comment #1 from Andrej Mitrovic <[email protected]> --- Current workaround: ----- import std.array; import std.algorithm; import std.typecons; void main() { int[int] map1 = [1:1, 2:2, 3:3]; int[int] map2 = assocArray(map1.byKeyValue().map!(k => tuple(k.key, k.value))); } ----- Notice that byKeyValue() does not return tuples, instead it returns 'Pair(...)' structs, so these can't directly be passed to `assocArray`. I suppose we could add an overload of `assocArray` that takes in `Pair()`s as arguments, but that seems a bit "leaky" abstractions to me. I'd rather we add an explicit 'duplicate' functionality to Druntime. --
