using __traits to get line number of a member

Ali Çehreli acehreli at yahoo.com
Sun Nov 14 19:09:56 UTC 2021


On 11/13/21 8:05 PM, forkit wrote:

 > static import mod = mixin(__MODULE__);
 >
 > That statement above would not compile.

I don't understand myself but all of it as a single string works:

mixin("static import mod = " ~ __MODULE__ ~ ";");

Ali



More information about the Digitalmars-d-learn mailing list