From: Marcus Lindblom (macke_at_[hidden])
Date: 2007-03-20 12:40:09
Pavol Droba wrote:
> I assume, you mean find/split iterators.
Yes. Sorry about that.
>> 1. Provide const overloads for make_foo_iterator funcs. Currently, I
>> can't use those functions to search f.ex. a const std::string. Works
>> fine when using the constructor directly though.
> The make_foo_iterator functions can handle both const and non-const
> sequences. The resulting type depends on the constness of the input.
> So no special const overload is necessary.
Indeed. I must've messed up my const definitions. I also confused
range_result_iterator with range_iterator.
>> 2. Make the filter_type public or templated (with boost::function as
>> default). Simply because I'd like to avoid dynamic memory allocation
>> when in functions creating those iterators. It feels a bit unnecessary
>> and I can't create something of filter_iterator_base::finder_type, since
>> it's protected.
> I'm not really sure what you are trying to achieve. boost::function is
> used to to handle the type erasure. As far as I know, it is not possible
> to do this without some dynamic allocation and virtualization.
> Without the type erasure, the find_iterators would have to be templated
> by the finder type.
That was what I was thinking. They could be templated there, but using
boost::function as a default template arg. This would provide type
erasure by default, but allow higher performance where needed. Since
it's already templated on one type, it might as well be on one more, or?
It's a minor thing though. Sorry for the noise.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk