Boost logo

Boost :

From: Hugo Duncan (hugoduncan_at_[hidden])
Date: 2003-10-09 10:07:16


I'm looking for the following MPL functionality and wondering if it
already exists somewhere.

I would like to use a runtime index into a typelist to execute a
metafunction (if I've got the terminology correct). At the moment
I can see how to implement this with mpl::for_each, but is there
a better way? Have I missed anything obvious?


instead of

   int i;
     case 0: my_template_fn< mpl::at<my_type_sequence,0> >(); break;
     case 1: my_template_fn< mpl::at<my_type_sequence,1> >(); break;
     case 2: my_template_fn< mpl::at<my_type_sequence,2> >(); break;

I would like to write


or similar.


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