--- Comment #2 from Shin Fujishiro <>  2009-05-26 02:51:35 PDT 
Created an attachment (id=380)
 --> (
Add .mangleof (DMD 2.030)

This patch adds .mangleof property to variables, functions, and templates.

Example and output:
int var;
void foo();
template T(int n) {}
pragma(msg, var.mangleof);
pragma(msg, foo.mangleof);
pragma(msg, T!(42).mangleof);

BTW, you can't tell whether a parameter has the "in" parameter storage class
from .mangleof. The "in" storage class is not embedded in type mangling (by
spec). You may want to use this instead:
import std.traits;
void foo(int a, in int b, ref int c);
enum b_stringof = ParameterTypeTuple!(foo)[1 .. 2].stringof;
pragma(msg, b_stringof);
(in const(int))
The slicing [1 .. 2] does the trick.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to