WIP: Copy combinations logic from demo

This commit is contained in:
David Allemang
2022-02-24 14:58:45 -05:00
parent 63eb9e47b4
commit 0502cb0a7e
3 changed files with 56 additions and 1 deletions

22
src/combotest.cpp Normal file
View File

@@ -0,0 +1,22 @@
#include <combo.hpp>
#include <iostream>
std::ostream &operator<<(std::ostream &o, const std::vector<int> &data) {
o << "[ ";
for (const auto &el: data) {
o << el << " ";
}
o << "]";
return o;
}
int main() {
std::vector<int> data{1, 2, 3, 4, 5};
for (const auto &combo: combinations(data, 3)) {
std::cout << combo << std::endl;
}
return EXIT_SUCCESS;
}