pragma(mangle, "name") suggestion !

Tim tim.dlang at t-online.de
Thu Mar 19 16:38:22 UTC 2020


On Thursday, 19 March 2020 at 04:59:14 UTC, Calvin P wrote:
> ===========
>  pragma(mangle,  name ~ "_myAction")
> void myAction(string name, ubyte[][] fields)(){
>
>
> }
> ===========

Another option is to pass a symbol instead of the data itself:

struct FieldsWrapper
{
     immutable ubyte[][] fields = [[1, 2, 3, 4]];
}
void myAction(string name, T)(){
     enum fields = T.fields;
}
void main()
{
     myAction!("test", FieldsWrapper)();
}

Now the mangled name of myAction contains only the struct name 
and not the complete data.


More information about the Digitalmars-d mailing list