$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: David Abrahams (dave_at_[hidden])
Date: 2006-05-29 13:53:35
Adrián Etchevarne <adrian.etchevarne_at_[hidden]> writes:
> Problem:
>   How can I get a tuple type from a tuples::cons<> list ?
> example:
>   given the type:
>      cons<int, cons<float, cons<int, null_type> > >
>
>   obtain
>      tuple<int, float, int>
>
>
> Real problem:
>    I need to insert a type T at the beginning of a tuple, how I can do this?
>
> example
>    given the type T and  tuple<int, float>, obtain a tuple<T, int, float> 
That's a lot easier to solve, in some sense, than the "Problem:"
above.  The cons list *is* a valid tuple.  So to inserta  new type at
the front, just write
    const<T, the-shorter-cons-list>
You might also want to look at
http://spirit.sourceforge.net/dl_more/fusion_v2/libs/fusion/doc/html/index.html
which was recently accepted into Boost.
-- Dave Abrahams Boost Consulting www.boost-consulting.com