Boost logo

Boost Users :

Subject: Re: [Boost-users] [Range] and [MemberFunction]
From: Philipp Moeller (philipp.moeller_at_[hidden])
Date: 2012-03-13 14:07:28

Robert Jones <robertgbjones_at_[hidden]> writes:

> On Tue, Mar 13, 2012 at 3:36 PM, Philipp Moeller <
> philipp.moeller_at_[hidden]> wrote:
>> I don't know Boost.MemberFunction and couldn't find any documentation
>> for it, could you provide a link?
>> But from what I can gather in your message, boost::mem_fn seems to be
>> exactly this:
>> for_each( xs.begin( ), xs.end( ), boost::mem_fn(& X::method) );
>> Granted, it is not exactly what you want, but gets very close.
> You're there already mem_fn is called 'Member Function' in the front page
> list.
> It is exactly the boost::mem_fn syntactic noise I was seeking to avoid.
> - R.
> -------------- next part --------------
> HTML attachment scrubbed and removed

You can overload functions to accept functors and member functions, but
then you end up with abominations like:

But I'm not sure if I haven't missed anything subtle in this for_each.

Philipp Moeller

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at