$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Joel de Guzman (joel_at_[hidden])
Date: 2007-08-14 19:17:56
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<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?
Seems like Fusion is your friend here :-)
Regards,
-- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net