From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2004-12-11 16:12:44
----- Mensaje original -----
De: David Abrahams <dave_at_[hidden]>
Fecha: Sábado, Diciembre 11, 2004 9:01 pm
Asunto: [boost] Re: boost::filter_iterator Model
> >> Is that stretching the definition of an iterator? I'm not sure.
> > That's too much for me.
> > I tend to think that it's stretching what users might expect
> when they see
> > "constant time amortized operation".
> This is tricky territory. It certainly warrants a note in the
> documentation, but I'm not exactly sure what to say.
I'm afraid that, generally speaking, filter_iterator<>
cannot just guarantee the std-required complexity, and
you cannot do anything about it (consider for instance
filter_iterator<is_prime<int>, counting_iterator<int> >)
To say it bluntly, not all instantiations of
filter_iterator<> are iterators.
I'd just say it so: "std-mandated complexity guarantees
are provided only if the number of skipped elements
divided by the length of the base range remains constant
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk