
3 Apr
2006
3 Apr
'06
6:33 a.m.
Nico Galoppo wrote:
Do you have an example of how that would work? I have no experience with boost::any.
It was just an idea actually, and not a very good one : I couldn't even make it work. I'm just discovering boost::any myself and I thought you could bind on it automagically. Using templates is simpler. template<typename R, typename V> void Set(As& as, R A::* setter, V value) { using namespace boost::lambda; std::for_each(as.begin(), as.end(), bind(setter, _1) = value); }