
Hi,
yes, this was indeed my idea.
it should be quite easy to check whether the class is an "old-style
iterator" or "new style iterator" and call the standard implementation
if this is applicable. I would branch using
is_same<
remove_const
(i.e. underlying type of X::reference is X::value_type) In my opinion, this would give real value to boost.range aside from the smarter interface :) On 2012-10-17 13:33, Jeffrey Lee Hellrung, Jr. wrote:
On Tue, Oct 16, 2012 at 11:08 PM, Oswin Krause
wrote: [...] would there be a general interest in a boost.iterator conforming implementation of stl algorithms?
I think any STL-like algorithms should be added to Boost.Range's existing collection of algorithms. I've personally found range interfaces to such algorithms (when appropriate) are significantly more convenient and easier to read.
It's possible, for example, that a given algorithm can use the one in the STL when the iterators are conforming standard iterators or when Boost detects the underlying STL implementation relaxes the standard requirements on iterators (e.g., does not actually require the reference type to be a real reference); and otherwise dispatch to a Boost-provided implementation.
Perhaps the present Boost.Range maintainer (Neil Groves, I believe?) can comment.
- Jeff
Links: ------ [1] mailto:Oswin.Krause@ruhr-uni-bochum.de