On Thursday, 25 January 2024 at 07:56:50 UTC, Ogi wrote:
String mixins are one the D’s killer features but the lack of string interpolation make them look like a mess.

You can use `q{}`

```d
mixin(q{
    static foreach(p; __traits(parameters))
    {{
        enum pname = __traits(identifier, p);
        static if(__traits(hasMember, this, pname)) {
            __traits(getMember, this, pname) = p;
            pragma(msg, "found member: " ~ pname);
            pragma(msg, __traits(getAttributes, p));
            pragma(msg, __traits(getAttributes, typeof(pname)));
            //pragma(msg, p);
        }
    }}
});
```

Reply via email to