Alias woes

SealabJaster sealabjaster at gmail.com
Sat Dec 12 01:02:56 UTC 2020


Please see this shortened snippet: https://godbolt.org/z/j8f3x5

I've ran into annoyances before when using aliases to member 
fields, but something subtle like this was rather annoying to 
figure out.

Why does the compiler feel the need to embed a context pointer 
anytime you provide an to alias a member?

In my case the function was also writing seemingly garbage values 
into the .ptr and .length fields for the ref'd string, but it 
doesn't seem to happen in the godbolt snippet.

Bonus, a pet peeve of mine: https://godbolt.org/z/bnK91f


More information about the Digitalmars-d-learn mailing list