diff options
Diffstat (limited to 'src/tx-intdiff.cpp')
-rw-r--r-- | src/tx-intdiff.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tx-intdiff.cpp b/src/tx-intdiff.cpp new file mode 100644 index 0000000..cd8ec7a --- /dev/null +++ b/src/tx-intdiff.cpp @@ -0,0 +1,24 @@ +#include <cstdio> +#include <iterator> +#include <vector> +#include <libHX/intdiff.hpp> +int main() +{ + std::vector<int> a{1, 2, 5}; + std::vector<long> b{2, 3, 4, 5}; + std::vector<float> comm, left, right; + + HX::set_intersect_diff(a.cbegin(), a.cend(), b.cbegin(), b.cend(), + std::back_inserter(comm), std::back_inserter(left), + std::back_inserter(right)); + for (auto e : comm) + printf("%f,", e); + printf("\n"); + for (auto e : left) + printf("%f,", e); + printf("\n"); + for (auto e : right) + printf("%f,", e); + printf("\n"); + return 0; +} |