Unqual

In D1 does nothing. In D2 strips top-most type qualifier.

This is a small helper useful for adapting templated code where template parameter can possibly be deduced as const or immutable. Using this type directly in implementation will result in unmodifiable variables which isn't always wanted.

Members

Aliases

Unqual
alias Unqual = U
Undocumented in source.
Unqual
alias Unqual = U
Undocumented in source.
Unqual
alias Unqual = T
Undocumented in source.

Examples

void foo(Element)(Element[] buf)
{
    // this causes an error with D2 if element
    // gets deduced as const
    Element tmp;
    tmp = Element.init;

    // this is ok in both d1 and D2
    Unqual!(Element) tmp;
    tmp = Element.init;
}

Meta