The OpenD Programming Language

mangle

Mangles a D symbol.

@safe pure nothrow
char[]
mangle
(
T
)
(
return scope const(char)[] fqn
,
return scope char[] dst = null
)

Parameters

T

The type of the symbol.

fqn const(char)[]

The fully qualified name of the symbol.

dst char[]

An optional destination buffer.

Return Value

Type: char[]

The mangled name for a symbols of type T and the given fully qualified name.

Examples

assert(mangle!int("a.b") == "_D1a1bi");
assert(mangle!(char[])("test.foo") == "_D4test3fooAa");
assert(mangle!(int function(int))("a.b") == "_D1a1bPFiZi");

Meta