|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-01-25 07:56:04
From: "David Abrahams" <david.abrahams_at_[hidden]>
> > What immediately comes to mind is, isn't it possible to make the
iterator
> > hold a shared_ptr<Predicate> instead? This solves the Assignable problem
> > and, in general, refcounting the function object is better in cases
where
> > it's stateful.
>
> Yeah, but makes the iterator a /lot/ heavier in the case where it's not
> stateful. I would want to have the user pass us the appropriate
> boost::function<>, or such like, when it's stateful. That's not a change
I
> would want to make users pay for.
In other words, make_filtered_iterator requires an Assignable predicate, and
will remain so?
Hmmm. :-)
> > I don't know. ref() is supposed to model a reference, and references
> aren't
> > reseatable; but, OTOH, I don't have any solid technical (as opposed to
> > conceptual) argument against the change.
>
> It's supposed to model a reference without some of the limitations: e.g.,
> you can pass it through a function template without losing its referential
> qualities. In any case, its modelling of reference is woefully incomplete
> (for example, if you assign to a reference it modifies the referent; there
> might be arithmetic opertors, etc.) FWIW, the reference_wrapper I had been
u
> sing for some time now uses Aleksey's implementation, and I would like it
> very much if he made the change he's proposing.
>
> However, the final decision rests with Peter, I guess...
>
> Peter?
As I said, I don't have a solid argument against the change; go ahead.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk