pragma(mangle, "name") suggestion !

Calvin P changlon at gmail.com
Sat Mar 21 14:00:51 UTC 2020


On Thursday, 19 March 2020 at 16:38:22 UTC, Tim wrote:
> 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.

Thanks for the tips.

with this methed I get a lot Error: variable name cannot be read 
at compile time

but the name is enum and I am able to use them as const pass to 
template.

and the new struct self has a very long symbol name.


On Thursday, 19 March 2020 at 17:04:13 UTC, Johan wrote:
>
> You can use LDC's --hash-threshold for this (hashes symbol 
> names larger than a certain threshold.
>
> -Johan

Thanks for reply.

I reduce the symbol name to easy debug process, I guess with 
hashes symbol  will not help here.



More information about the Digitalmars-d mailing list