Multiline string literal improvements

captaindet 2krnk at gmx.net
Tue Oct 10 21:38:41 UTC 2017


> string a = |q{
>                   firstLine();
>                   if (cond) {
>                       secondLine()
>                   }
>                };

you could write your own string processing function according to your 
needs to filter the code string, and use it like
string a = inject(q{...})  			//or
string a = inject!(formatOpts)(q{...})

i have done this myself and also included positional argument formatting 
to my liking, optimized for CT code generation. don't have the code at 
my hands ATM though. could post it later if you are interested.

/det



More information about the Digitalmars-d mailing list