Boost logo

Boost Users :

From: Fredrik Blomqvist (fredrik_blomqvist_at_[hidden])
Date: 2005-05-10 11:38:56


Adi Shavit wrote:
>> You can switch to boost::lambda::bind and use &_1, or you can write
>> address_of:
>>
>> template<class T> T * address_of( T & t ) { return &t; }
>>
>> and use
>>
>> boost::bind( myFun, boost::bind( &address_of<int>, _1 ) );
>
> Thanks!
> I thought it should be that simple, I just assumed there would be such
> an adapter already inside boost.

Well, actually there is:
http://www.boost.org/libs/utility/utility.htm#addressof
... and Peter is one of the authors ;-)

Regards
// Fredrik Blomqvist


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