const_cast

Allows casting between qualified versions of the input type. The unqualified version of the types need to be implicitly convertible in at least one direction.

nothrow @nogc pragma(inline, true) ref @trusted
T
const_cast
(
T
U
)
(
auto ref U from
)

Examples

const(char)* myString = "Hello, world!";
char* myStringMut = const_cast!(char*)(myString);

Meta