Simplifying a string mixin

Victor Porton porton at narod.ru
Mon Feb 25 20:57:37 UTC 2019


Can string mixing be split into several parts?

I have a mixin like this:

     mixin("struct " ~ name ~ " {\n" ~
           "  struct Regular {\n" ~
           "    // ..." ~
           "  }\n" ~
           "  struct WithDefaults {\n" ~
           "    // ..." ~
           "  }\n" ~
           '}');

I would like to split it into several mixins (preferably using 
regular non-string mixins).

Are things like this possible?

Also, what is the most proper thing to check that `name` is a 
proper identified (not say !@#)?


More information about the Digitalmars-d-learn mailing list