|
Boost : |
From: David B. Held (dheld_at_[hidden])
Date: 2002-09-17 02:05:24
"Shane Beasley" <sbeasley_at_[hidden]> wrote in message
news:Pine.GSO.4.10.10209162247580.6164-100000_at_bert.cs.uic.edu...
> [...]
> (b) Use boost::lambda to do something similar to the above. Unfortunately,
> I cannot see any way for boost::lambda to emulate the functionality of
> compose_f_gx; bind(f, g, x) is f(g, x), which isn't very useful here.
> [...]
I would recommend boost::bind(). All compose_f_gx() does is chain
two bind calls together (effectively). You can call nested bind()s, of
course.
You want something like:
boost::bind(select2nd(), boost::bind(func, _1))
As you can imagine, select2nd just helps you get at the second member
of a pair. A lot of people write this themselves, but there may be
something
useful in boost::tuples.
Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk