Boost logo

Boost Users :

From: me22 (me22.ca_at_[hidden])
Date: 2006-02-17 14:01:00


On 2/17/06, Sebastian Redl <sebastian.redl_at_[hidden]> wrote:
> How about an indirect_iterator?
>

Or maybe a ptr_vector, so that your iterators are automatically indirect?

lambda needs result deduction, which is hard, but you could always
write your own simple dereferencing functor along the lines of the
following:
template <typename T>
struct dereference_as {
    template <typename P>
    T &operator()(P ptr) {
        return *ptr;
    }
}

and then
for_each( aVector.begin(), aVector.end(), bind(&myFunc, bind(
dereference_as<A>(), _1) ) );

~ Scott McMurray


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