Boost logo

Boost Users :

From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2006-05-29 11:41:01

Adrián Etchevarne ha escrito:

> 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>
> Thanks in advance,
> Adrián

Hi Adrián, I think you've got to resort to brute force, although
Boost.PP helps a lot with this kind of tasks. Please find attached
a possible implementation of a tuple_from_cons helper metafunction,
though I'm sure the PP experts out there could come out with simpler
and nicer formulations.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Antes de imprimir este mensaje, asegúrese de que es necesario.
La mejora del medio ambiente empieza en nuestro día a día.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at