-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[c++17] replace boost optional with std::optional in zip_longest #32
Comments
|
Is it possible to replace boost::optional with C Pointers in zip_longest? |
I can't imagine how, do you have something in mind? |
#include <zip_longest.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"};
// i: int*
// s: std::string*
for (auto&& [i, s] : iter::zip_longest(ivec, svec)) {
if (i) {
std::cout << *i << std::endl;
}
if (s) {
std::cout << *s << std::endl;
}
}
} |
of course you could implement a |
Changing the type to a pointer doesn't change the existing usage, does it? |
I can't change the library in a way that breaks existing users if they update to a newer version of the library. |
The text was updated successfully, but these errors were encountered: