Boost logo

Ublas :

From: Fernando Herrero Carrón (fernando.herrero_at_[hidden])
Date: 2006-06-16 10:01:53


You hit it!!!

I think I am already too used to passing refs and shared_ptr's around,
and forgot passing by value. Anyway, I also think my design is too
complicated by now, so I should rethink it under the light of the last
two responses.

This solved my problem, thank you very much.

Best regards,
Fernando

El vie, 16-06-2006 a las 15:43 +0200, Markus Schöpflin escribió:
> Note that I didn't try if this really works but since for_each makes a copy
> of the supplied functor, I strongly suspect that this will help you.
>
> Fernando Herrero Carrón wrote:
>
> ...
>
> > Accumulator ac;
> > std::for_each(l.begin(), l.end(), ac);
> ac = std::for_each(l.begin(), l.end(), ac);
> > std::cout << ac.get_sum() << std::endl;
>
> ...
>
> HTH, Markus