#include #include #include #include #include #include // prints Just VALUE or Nothing template std::ostream & operator<<(std::ostream & out, const boost::optional& opt) { if (opt) { out << "Just " << *opt; } else { out << "Nothing"; } return out; } int main() { std::vector ivec = {1, 4, 9, 16, 25, 36}; std::vector svec = {"hello", "good day", "goodbye"}; std::cout << "zipping a vector of strings with a vector of ints:\n"; for (auto&& e : iter::zip_longest(ivec, svec)) { std::cout << '(' << std::get<0>(e) << ", " << std::get<1>(e) << ")\n"; } }