mixin identifiers concept
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Wed Feb 2 12:19:57 UTC 2022
On Monday, 31 January 2022 at 20:45:53 UTC, Paul Backus wrote:
> Using `std.format` for this incurs a substantial compile-time
> performance penalty--dozens of templates must be instantiated,
> memory must be allocated for CTFE, the format string must be
> validated, etc. If the mixin is inside a template which is
> itself instantiated many times, this overhead can really add up.
String mixins should be discouraged, not encouraged. Adding more
band aids or special cases is not the right approach.
If compile time string processing is the root issue then one
shouldn't solve that by changing the semantics of mixin(). That
performance issue can be fixed by introducing classic string
interpolation.
More information about the Digitalmars-d
mailing list