Boost logo

Boost :

From: Sean Parent (sparent_at_[hidden])
Date: 2002-07-09 18:46:37


I'm trying to use bind with for_each but I need a copy of the bound function
object back after for_each. I've tried using boost::ref(f) but that just
gives me a compiler error (CW 7.2) that the result type isn't defined
(apparently on the wrapped reference.

...
    Function f;
    // How do I get a copy of f back?
    ??? = std::for_each(first, last, boost::bind(f, _1));
...

...
    // This won't compile
    Function f;
    std::for_each(first, last, boost::bind(boost::ref(f), _1));
    return f;
...

Any ideas?
Thanks,
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