
14 Aug
2007
14 Aug
'07
10:58 p.m.
I am trying to generalize the concept of putting database data into boost::tuple objects. I'm thinking syntax similar to something like so: typedef boost::tuple<int, double, std::string> row; row r = SqlQuery<row>::run_query(db, "select * from x"); I imagine something like so being contained in the processing: TUPLE t; ... t.get<X>() = boost::lexical_cast< typename boost::tuples::element<X,TUPLE>::type >(data[X]); // data is char ** Where X is the index of the element and the entire tuple is iterated in this manner. I thought maybe there would be something in MPL that could help but I'm not seeing it. Anyone got any bright ideas?