From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-07-09 06:56:04
From: "David B. Held" <dheld_at_[hidden]>
> "Paul Mensonides" <pmenso57_at_[hidden]> wrote in message
> > One concern however.... should the closure facility disallow normal
> copying if
> > it is working in concert with a shared_ptr?
You need to return the closure by value, so it has to be copyable.
> I have no idea! I barely grok the implementation. One thing that worries
> is that you leak the pointer to create the closure. What would be nice is
> the closure itself contained a shared_ptr! Otherwise, the shared_ptr
> self-delete, and someone might try to call the closure.
This depends on whether you need a closure library or just an operator->*.
You aren't allowed to do anything with the result of ->*; the only thing you
are allowed to do is to immediately apply operator() to it. There is no need
to worry about lifetime issues.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk