unsafeCast

Down cast of a reference to a child class reference runtime check is disabled in release build If T is a base class of U, this does a blind cast to the same address. If T is an interface implemented by U, it first offset address to the object base address and does a blind cast to that address.

  1. U unsafeCast(T obj)
    template unsafeCast(U)
    @system
    U
    unsafeCast
    (
    T
    )
    (
    T obj
    )
    if (
    (
    is(T == class) ||
    is(T == interface)
    )
    &&
    is(U : T)
    )
    if (
    !is(U == const)
    )
  2. template unsafeCast(U)

Members

Functions

unsafeCast
U unsafeCast(T obj)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta