Boost logo

Boost Users :

Subject: Re: [Boost-users] boost solution for transforming stl algorithms on proxy iterators?
From: Oswin Krause (Oswin.Krause_at_[hidden])
Date: 2012-10-17 07:53:03


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<remove_reference<iterator_reference<X>::type>::type>::type,
     iterator_value<X>::type
>
(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
> <Oswin.Krause_at_[hidden] [1]> 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_at_[hidden]


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net