Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-11-22 09:49:34


On Friday 22 November 2002 09:28 am, Martin Bosticky wrote:
> Hi
>
> I have I not a template boost guru but i have developed a 'functor adapter'
> that I think could be usefull. To best of my knowledge the following is
> currently not provided by boost library yet. Please let me know otherwise.
>
> Functor adapter: adaptor2ndArgument and other appropriate variants can take
> a functor, and create a new functor with a new argument type such that it
> takes an object but uses that objects member. This would be usefull when
> you want to search a container of some object type based on one of its
> member data/functions. Normally the same affect can be achieved by writing
> custom functors but that can get very tedious.

Boost.Bind and Boost.Lambda can do this as well. The Bind syntax is:

  boost::bind(&Operation::m_Name, _1)

The Lambda syntax is:

  (&_1)->*&Operation::m_Name

        Doug


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk