|
Boost Users : |
From: Christian Henning (chhenning_at_[hidden])
Date: 2006-08-22 14:26:05
Thanks, that worked now. I like the fusion::for_each loop, it's very handy!
Anyway, when I started this thread I actually had something else in my
mind. As you can see the doSomething() is templated. I would like to
create a type vector depending on the template parameter, here S. Is
that possible?
I could image to have something like this ( beware bad pseudo code ):
template <class S> void doSomething( S& s )
{
//create vector depending on S's length
typedef fusion::vector<S::num_values> vec; // vector length
// add the members type to vec
fusion::for_each_member( s, vec.add() );
// create boost tuple type out of vec
fusion::make_tuple( vec );
}
Am I totally fantasying here? I think all the infomation are available
at compile time.
Thanks again,
Christian
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