forked from ryanhaining/cppitertools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzip_examples.cpp
More file actions
17 lines (13 loc) · 474 Bytes
/
Copy pathzip_examples.cpp
File metadata and controls
17 lines (13 loc) · 474 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <zip.hpp>
#include <vector>
#include <string>
#include <iostream>
int main() {
std::vector<int> ivec{1, 4, 9, 16, 25, 36};
std::vector<std::string> svec{"hello", "good day", "goodbye"};
// zip terminates on the shortest sequence, and is variadic
std::cout << "zipping a vector of ints and a vector of strings\n";
for (auto&& e : iter::zip(ivec, svec)) {
std::cout << '(' << std::get<0>(e) << ", " << std::get<1>(e) << ")\n";
}
}