Boost logo

Boost :

From: Rodolfo Lima (rodolfo_at_[hidden])
Date: 2008-03-06 16:16:51


vicente.botet escreveu:
> I'm interesteed in a non preprocesor solution to the following
> transformation which bind N args in a mpl sequence (vector) to a
> boost:parameter:paramers signature.
>
> // bind to the signature the Args provided
> // template <typename Signature, typename... Args>
> // struct args;
> template <typename Signature, typename Args>
> struct args;
> template <typename Signature, typename Arg0>
> struct args<Signature, mpl::vector<Arg0> > {
> typedef typename Signature::template bind<Arg0>::type type;
> };
> template <typename Signature, typename Arg0, typename Arg1>
> struct args<Signature, mpl::vector<Arg0, Arg1> > {
> typedef typename Signature::template bind<Arg0, Arg1>::type type;
> };*
> ...
> template <typename Signature, typename Arg0, typename Arg1, ..., typename
> ArgN>
> struct args<Signature, mpl::vector<Arg0, Arg1, ..., ArgN> > {
> typedef typename Signature::template bind<Arg0, Arg1, ..., ArgN>::type type;

I suppose you can write:

template <typename Signature, typename... ARGS>
struct args<Signature, mpl::vector<ARGS...>>
{
        typedef typename Signature::template bind<ARGS...>::type type;
};

Didn't test it tough...

Regards,
rod


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk