Battle-plan for CTFE

Stefam Koch via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Wed Oct 26 08:02:28 PDT 2016


Who can guess what this code does ?


char[] obfuscatedFn(string a, string b, uint aLength = 0, uint 
bLength = 0, uint cLength = 0, uint pos = 0, uint bPos = 0, 
char[] result = [])
{
     aLength = cast(uint)a.length;
     bLength = cast(uint)a.length;
     cLength = aLength + bLength;
     result.length = cLength;
     while(aLength--)
     {
         result[pos] = a[pos];
         ++pos;
     }
     while(bLength--)
     {
         result[pos] = b[bPos++];
         ++pos;
     }

     return result;
}





More information about the Digitalmars-d-announce mailing list