I would say to move it to src. Can't you write it in terms of [std::next_permutation][http://www.cplusplus.com/reference/algorithm/next_permutation/]?