Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-12-08 22:13:11


Eric Niebler wrote:
> The iterator_adaptor<> template has a base() function to access the
> underlying iterator. Well and good. However, iterator_adaptor<> doesn't
> have a public typedef for the iterator type returned from this function.
> Can it be added?
>
> Rationale:
> Given some iterator of type T that is built of an unknown number of
> adaptors, extract the underlying iterator. Consider:
>
> template<class Iter>
> typename disable_if<is_adapted<Iter>,Iter>::type
> base(Iter const & it)
> {
> return it;
> }
>
> template<class D,class B,class V,class T,class R,class Di>
> ??????????
> base(iterator_adaptor<D,B,V,T,R,Di> const & it)
> {
> return base(it.base());
> }
>
> I can't think of a way to write the return type of the second overload.
> If iterator_adaptor had a nested typedef for its Base template
> parameter, this would be very straightforward.

Seems reasonable. Can you submit a patch?

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

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