Const

Helper template to be used instead of plain types in function parameter list when one will need to be const-qualified in D2 world - usually this is necessary if function needs to handle string literals.

This should be used instead of istring/cstring aliases in generic array processing functions as opposed to string-specific code.

template Const (
T
) {}

Members

Aliases

Const
alias Const = const(T)
Undocumented in source.

Examples

void foo(Element)(Const!(Element)[] buf)
{
}

foo!(char)("aaa"); // will work in both D1 and D2

Meta