>> 2. Why does nextPermutation hang up for empty arrays? I >> suppose that's a bug? > > I suppose so. Please file it. If it is deemed "illegal", at the > very least, it should throw. My fault, i mis-used it. The right behavior for ranges of size 0 and 1 is checked explicitly in the unittests. Ivan Kazmenko.