-
-
Save minamiyama1994/c79a5f72a323e6614bf8 to your computer and use it in GitHub Desktop.
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
template<int N, typename... T> | |
auto zip(const std::array<T, N>&... containers) -> std::array < std::tuple < T ... > , N > | |
{ | |
std::array < std::tuple < T ... > , N > res ; | |
for ( std::size_t i = 0 ; i != N ; ++ i ) | |
{ | |
res [ i ] = std::make_tuple ( containers [ i ] ... ) ; | |
} | |
return res ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment