compose

Synopsis

template <
  class F1,
  // ...
  class Fn
>
struct compose
{
  // unspecified
};

Description

Higher order function taking metafunction classes as arguments and generating their composition.

#include <mpllibs/metamonad/compose.hpp>

Expression semantics

For any f1 ... fn metafunction classes taking 1 argument and x1, ..., xk classes

boost::mpl::apply<compose<f1, .... fn>, x1, ..., xk>

is equivalent to

boost::mpl::apply<f1, ... boost::mpl::apply<fn, x1, ..., xk>::type ... >

Example

struct make_pointer
{
  template <class T>
  struct apply : boost::mpl::identity<T*> {};
};

typedef
  boost::mpl::apply<compose<make_pointer, make_pointer>, int>
  int_ptr_ptr;

[up]