Combinations iterator, for #3989
based on code by @kmsquire