https://issues.dlang.org/show_bug.cgi?id=15982
--- Comment #6 from [email protected] --- (In reply to ag0aep6g from comment #5) > Here's a little generic function that relies on std.array.array's current > behavior: > ---- > immutable(ElementType!R)[] toImmutableArray(R)(R range) > if (isInputRange!R && !hasIndirections!(ElementType!R)) > { > import std.array: array; > import std.exception: assumeUnique; > return assumeUnique(range.array); > } > ---- Missing imports: ---- import std.range: ElementType, isInputRange; import std.traits: hasIndirections; ---- --
