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)
    @trusted
    inout(U)[]
    upcastElementsTo
    (
    U
    T
    )
    (
    scope inout(T)[] x
    )
    if (
    is(T == class) &&
    is(U == class)
    )
  2. auto upcastElementsTo(inout(R) x)

Meta