MPL11
 All Classes Namespaces Files Typedefs Macros Groups Pages
boost::mpl11::zip_with< f, lists > Struct Template Reference

Returns a list of applications of f to the elements of the zipped lists, in lockstep. More...

#include <boost/mpl11/fwd/list.hpp>

Detailed Description

template<typename f, typename... lists>
struct boost::mpl11::zip_with< f, lists >

Returns a list of applications of f to the elements of the zipped lists, in lockstep.

Specifically, the i-th element of the list is equivalent to f(s1[i], ..., sn[i]), where f(...) denotes metafunction class suspension and sk[i] denotes the i-th element of the k-th list passed as an argument.

The list stops when the shortest zipped list is exhausted. When invoked with 0 arguments, zip returns an empty list.

Todo:
  • Consider implementing a zip_longest with the obvious semantics.
  • zip_with is some kind of generalization of fmap with several Functors at a time. Is this interesting?