Boost logo

Boost :

Subject: Re: [boost] [range] why not adding conversion operator std::pair<FTI.FTI> to boost iterator_range
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2014-06-11 09:45:44


On Wednesday 11 June 2014 14:49:48 Andreas Fabri wrote:
> On 11/06/2014 14:34, Andrey Semashev wrote:
> > On Wednesday 11 June 2014 08:58:44 Andreas Fabri wrote:
> >> Wouldn't it be a good idea to add a conversion operator to
> >> the class iterator_range?
> >
> > I suppose, the problem is that there is no reliable way to know that a
> > certain type T is an iterator.
> >
> By contract it is an ForwardTraversalIterator
>
> template< class ForwardTraversalIterator >
> class iterator_range

Yes, but AFAIK this requirement is not enforced in code. The implementation
should prohibit conversion from pairs of types that are not model of this
concept. Implementing that check might be difficult or heavy for the rest use
cases.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk