Skip to content

Instantly share code, notes, and snippets.

@y-yu
Created November 26, 2013 02:09
Show Gist options
  • Save y-yu/7652450 to your computer and use it in GitHub Desktop.
Save y-yu/7652450 to your computer and use it in GitHub Desktop.
map
template<int N, template<class T, class...A> class F, typename... U>
auto map(const F<T(U...)> f, const std::array<U, N>&... containers) -> T
{
std::array< T, N > res;
for (std::size_t i = 0; i != N; i++) {
res[i] = f( containers[i]... );
}
return res ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment