instantiate

Synopsis

template <template <class, ..., class> class T>
struct instantiaten
{
  template <class V>
  struct apply
  {
    // unspecified
  };
};

Description

Metafunction class for template instantiation. It takes a sequence of classes as argument and instantiates the template T with those classes. It returns the instantiated template. The sequence may have less elements than the number of template arguments T expects. In such cases boost::mpl::na is used instead of the non-specified arguments.

The largest supported arity is the value of MPLLIBS_INSTANTIATE_ARITY. The default value of it is 32.

#include <mpllibs/metamonad/instantiate.hpp>

Expression semantics

For any n > 0, k >= 0, n >= k, c1, ..., ck classes and t template class taking n classes as template arguments

instantiaten<t>::apply<boost::mpl::vector<c1, ..., ck>>::type

is equivalent with

t<c1, ..., ck, boost::mpl::na, ..., boost::mpl::na>

Example

typedef apply<instantiate<pair>, boost::mpl::vector<int, int>>::type int_pair;

[up]