Boost logo

Boost Users :

From: loufoque (mathias.gaunard_at_[hidden])
Date: 2006-04-03 08:33:50


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);
}


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