https://issues.dlang.org/show_bug.cgi?id=12512
Nick Treleaven <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #4 from Nick Treleaven <[email protected]> --- (In reply to monarchdodra from comment #3) > Just to be clear, my need is: > Given a type T (which may be qualified), I need a function that can do this: > > //---- > T[] output = intput.someDup(); > //---- You can just use dup: int[] ma = [1, 2, 3]; immutable(int)[] ia = ma.dup; I think current dmd can do this because it knows ma.dup is unique, so it can safely convert to immutable. --
