tempdup - multiple declarations

Function tempdup

Creates a duplicate of a range for temporary use within a function in the best wsy that can be done safely. If ElementType!(T) is a value type or T is an array, the results can safely be placed in TempAlloc because either it doesn't need to be scanned by the GC or there's guaranteed to be another reference to the contents somewhere. Otherwise, the results are placed on the GC heap.

Unqual!(ElementType!T)[] tempdup(T) (
  T data
)
if (isInputRange!T && (isArray!T || !isReferenceType!(ElementType!T)));

This function is much faster if T has a length, but works even if it doesn't.

Function tempdup

Unqual!(ElementType!T)[] tempdup(T) (
  T data
)
if (isInputRange!T && !(isArray!T || !isReferenceType!(ElementType!T)));