Boost logo

Boost Users :

From: Noah Roberts (roberts.noah_at_[hidden])
Date: 2007-08-14 18:58:26


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?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net