upcastElementsTo

Upcast all elements in x of type T to the type U, where U is a superclass of T.

TODO move to phobos-next

  1. inout(U)[] upcastElementsTo(inout(T)[] x)
  2. auto upcastElementsTo(inout(R) x)
    @trusted
    upcastElementsTo
    (
    U
    R
    )
    (
    inout(R) x
    )
    if (
    !isArray!R &&
    is(U == class)
    &&
    isInputRange!R
    &&
    is(ElementType!R == class)
    )

Meta