14 Aug
2007
14 Aug
'07
11:17 p.m.
Noah Roberts wrote:
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
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
::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?
Seems like Fusion is your friend here :-) Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net