Metaprog can be abstruse

kdevel kdevel at vogtner.de
Wed Jul 6 00:03:28 UTC 2022


On Tuesday, 5 July 2022 at 07:37:35 UTC, Alexandru Ermicioi wrote:
[...]
> To be fair, original example also requires some testing.

Sure, but user1234 was never in favor of it. It is prone to the 
same wrap around which have been avoided by using strings in the 
first place:

```
auto sgenDecimalRanks()
{
     auto r = "1";
     auto result = "[";
     foreach (i; 1 .. 13)
     {
         result ~= r;
         if (i < 12)
             result ~= ", ";
         r ~= '0';
     }
     result ~= "]";
     return result;
}
```






More information about the Digitalmars-d mailing list