On 9/27/05, Stuart Dootson <stuart.dootson@gmail.com> wrote:
That's not going to work because the operator() call in the loop (i.e.
m(...)) is evaluated when the lambda expression is created, not each
time the lambda expression is evaluated.
Try replacing
var( m( c / m.w, c % m.w ) )
with
bind(&MyMatrix::operator(), var(m), var(c) / m->*&MyMatrix::w, var(c)
% m->*&MyMatrix::w)
This makes all accesses to m & c lazy (I think), so should update m as you want.