mirror of
https://github.com/allemangD/toddcox-visualize.git
synced 2025-11-10 12:02:47 -05:00
WIP: Copy combinations logic from demo
This commit is contained in:
22
src/combotest.cpp
Normal file
22
src/combotest.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user