Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-03-15 13:26:51


Thomas Matelich wrote:
>> This may be a reasonable regression, but I thought I'd bring it up in
>> case its a regression that should be fixed. My sample code and some
>> error outputs are attached.

This regression is caused by the fact that in 1.32, bind( &Foo::bar, _1 ) no
longer returns a reference to Foo::bar; it wants to return by value instead.

The change was motivated by the fact that bind( &Foo::bar, bind(
createFoo ) ), where createFoo returned a Foo by value, would return a
reference to an object that was already destroyed.

You can fix your example by using bind<string>( &Foo::bar, _1 ), which
should work on the compilers you listed.

The CVS version also supports

    bind<string>( &Foo::bar, _1 ) == test


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