printf() metaprogramming challenge

bpr brogoff at gmail.com
Fri May 24 04:49:22 UTC 2019


On Thursday, 23 May 2019 at 19:33:15 UTC, Walter Bright wrote:
> string formatString(string f, string[] A ...)
> {
>     string r;
>     size_t i;
>     size_t ai;
>     while (i < f.length)
>     {
> 	if (f[i] != '%' || i + 1 == f.length)
> 	{
> 	    r ~= f[i];


Are you sure this works for betterC? It's been a while for me, 
but I think it won't, the string appends will stop it.

Good job at getting unit tests and final switch in!

> ----- End Of Das Code ----------




More information about the Digitalmars-d mailing list