Code runtime

Ausprobierer via Digitalmars-d digitalmars-d at puremagic.com
Sun Jun 5 15:42:01 PDT 2016


> I never used those methods neither in D nor in C++ but I have a 
> gut feeling it is the nextPermutation method in phobos, [...]
>
> --stephan

I think you're right, it probably is the nextPermutation() 
function:

<imports>
long[] z = [1,1,2,2,3,3,4,4,5,5,6,6,0,0];

void main()
{
     do
     {
         if (z[0] == 0) break;
     }
     while (nextPermutation(z));
}

...takes approx. 31 seconds, compiled with "-m64 -O -release 
-inline".


More information about the Digitalmars-d mailing list