Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2003-10-23 14:24:18

"Joel de Guzman" <joel_at_[hidden]> wrote in message
> [...]
> The Fusion lib (in the sandbox) hopefully to replace the old tuple
> lib can do that easily (example):
> typedef boost::mpl::list<int, double, X, int> mpl_list1;
> type_sequence<mpl_list1> view;
> std::cout << generate(view) << std::endl;
> generate(view) creates a tuple from the view.

This looks promising, but could you briefly explain what a view
is? And can I just create my tuple directly from the sequence?
Like so:

template <typename T>
struct foo
    typedef typename as_sequence<T>::type my_types;

    foo(void) : my_tuple(generate(type_sequence<my_types>())) { }

    tuple<???> my_tuple;

Remember that I'm trying to get to here:


That is, I want to be able to access the individual tuple elements
at run-time. So if there's a better way to do that in fusion, then
I'm all ears.


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
Version: 6.0.521 / Virus Database: 319 - Release Date: 9/23/2003

Boost list run by bdawes at, gregod at, cpdaniel at, john at