`revdoor`

is a single-file C++ library for visiting *revolving door* combinations.

The *combinations without replacement* generator implements Algorithm R from TAOCP 7.2.1.3 [1]. The *combinations with replacement* generator implements the same algorithm, modified to support replacement.

The algorithms visit combinations by indicating at most two pairs of items to swap in and out on each iteration.

The source code is available on GitHub:

https://github.com/dstein64/revdoor