In article
I am lost, even after looking at the code, of what protect is supposed to do in combination with boost::bind.
An example where you need to use protect is when you want to call bind and pass the result of a bind to one of its arguments: function<...> f1 = bind(foo, ...); function<...> f2 = bind(bar, ..., f1, ...); The reason for this is that when the result of bind #1 is passed to bind #2, then #1 is evaluated immediately, i.e., foo() is called not from inside bar() as you might desire, but on the second line above where bind is called. However, if you instead call function<...> f2 = bind(bar, ..., protect(f1), ...); then the call to foo() is deferred until the body of bar(). hth meeroh -- If this message helped you, consider buying an item from my wish list: http://web.meeroh.org/wishlist