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
news:02b501c3994b$a8625780$64646464_at_godzilla...
> [...]
> 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:

get<3>(foo().my_tuple);

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.

Dave

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

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