
4 May
2010
4 May
'10
7:59 a.m.
Hi, I was trying to implement something equivalent to the following piece of code: template <class Field1, class Field2, ... , class FieldN, class Range, class Function> Function for_each(Range &r, Function f) { using namespace boost; using namespace boost::fusion; BOOST_FOREACH(typename range_value<Range>::type &v, r) { at_key<Field1>(v) = f(at_key<Field2>(v), at_key<Field3>(v), ... , at_key<FieldN>(v)); } return f; } Is there a simple way to do this using fusion's current functionalities? Regards, Denis