Skip to content

Instantly share code, notes, and snippets.

@minamiyama1994 minamiyama1994/zip.cpp Secret
Created Nov 25, 2013

Embed
What would you like to do?
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
You can’t perform that action at this time.