On Sun, Jan 23, 2011 at 2:40 AM, TONGARI <tongari95@gmail.com> wrote:

Use Fusion's MPL  sequences adapters, so you can have:

typedef typename
        mpl::transform
        <
            parameter_types
          , from_data_source<mpl::_1>

          , mpl::back_inserter<mpl::vector<> >
        >::type
data_source_provider; // a MPL  sequence

And invoke as:

fs::invoke(f, data_source_provider());

where from_data_source<T> is defined as:

template<class T>
struct from_data_source
{
    operator T() const

    {
        return data_source<T>().pop();
    }
};

Maybe your data_source<T>() is some singleton for the data source?

Hmm! That seems more succinct than the explicit recursion in the interpreter.hpp example.

Apologies if this is a silly question, but suppose the object from which I'd like to obtain parameter values is locally constructed rather than global? How would I parameterize the mpl::transform expression above to pass in that object?