generate tuples by mpl -- should I use fusion?

I need to be able to convert a mpl sequence into something like a tuple: typedef boost::mpl::vector<double> CMplSequence; typedef CCreateVectorFromMpl<CMplSequence>::type CVector; I need to have runtime access with constant index: CVector s; get<0>(s) = 1.0; std::cout << get<0>(s) << "\n"; I need to be able to retrieve the type at compile time -- preferably as a mpl sequence. I already wrote something like this using std::pair as the tuple but I'm running into problems storing reference types on Windows. Peter

Am Friday 08 January 2010 03:02:52 schrieb Peter Foelsche:
I need to be able to convert a mpl sequence into something like a tuple:
typedef boost::mpl::vector<double> CMplSequence; typedef CCreateVectorFromMpl<CMplSequence>::type CVector;
typedef boost::mpl::vector<double> CMplSequence; typedef typename boost::fusion::results_of::as_vector<CMplSequence>::type tuple_type; tuple_type tuple(2.5);
participants (2)
-
Peter Foelsche
-
Stefan Strasser