
Hi Denis, seems you want to avoid boilerplate code repetition. Denis Taniguchi schrieb:
Hi,
I was trying to implement something equivalent to the following piece of code:
template
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));
How about using boost preprocessor macro to do the code repetition? For example using BOOST_PP_ENUM_PARAMS ?
} return f; }
Is there a simple way to do this using fusion's current functionalities?
As far as i know, there is no ther simpler way just using fusion. Regards, Kim
Regards,
Denis
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users