Boost logo

Boost :

From: Sean Parent (sparent_at_[hidden])
Date: 2002-04-16 13:55:58


One feature that I think is missing from functional (and bind) is the
ability to deal with a pointer or reference to a data member.

The behavior should be similar to binding to a pointer to a member function
- it generates a functor that given an object returns the value of the
member.

One example use would be doing a lookup on an array of pairs of an int and a
float:

find_if(first, last,
    compose_f_gx(bind(equal_to<int>(), value, _1),
        mem_ref(&pair<int, float>::first));

Thoughts?
Sean

-- 
Sean Parent
Sr. Computer Scientist II
Advanced Technology Group
Adobe Systems Incorporated
sparent_at_[hidden]

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