template <class List, class F>
struct concat_map
{
// unspecified
};
concat_map is a metafunction applying the function F on all elements of the sequence List. The result of applying F on an element is expected to be a sequence. These sequences are concatened and that is the result of this operation.
#include <mpllibs/metamonad/concat_map.hpp>
For any l sequence of n elements and f metafunction taking one argument:
concat_map<l, f>::type
is equivalent to
concat<
boost::mpl::apply<f, boost::mpl::at_c<l, 0>::type>::type,
concat<
boost::mpl::apply<f, boost::mpl::at_c<l, 1>::type>::type,
// ...
boost::mpl::apply<f, boost::mpl::at_c<l, n>::type>::type
// ...
>::type
>::type
typedef
concat_map<
boost::mpl::list<boost::mpl::int_<1>, boost::mpl::int_<2> >,
lambda_c<t, list<t, t> >
>::type
list_of_1_1_2_2;
Copyright Abel Sinkovics (abel at elte dot hu) 2013. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt