Last active
December 29, 2015 09:49
-
-
Save y-yu/7652552 to your computer and use it in GitHub Desktop.
map example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::array<int, 5> a = {1, 2, 3, 4, 5}; | |
std::array<char, 5> b = {'a', 'b', 'c', 'd', 'e'}; | |
// 前に作ったzip | |
auto z1 = zip<5>(a, b); | |
// map | |
auto z2 = map<5>( | |
[](int x, char y) -> std::tuple<int, char> { | |
return std::make_tuple(x, y); | |
}, | |
a, b | |
); | |
// 同じになる! | |
z1 == z2; // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment