Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-07-10 16:53:07


Better, but still not what I had in mind. I think the metaprogram ought to
go in indirect_iterator_generator so it can be used to select the right
value type even when the generator is used.

make_indirect_iterator is /supposed/ to be portable to MSVC; it just isn't
;-(. I think it could be made to work for some obvious cases, with a little
effort. Not sure if it's worth it, though.

-Dave

----- Original Message -----
From: "Alexander Belopolsky" <belopols_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Tuesday, July 10, 2001 3:50 PM
Subject: [boost] Re: iterator_adaptor library bug

> --- In boost_at_y..., "David Abrahams" <david.abrahams_at_r...> wrote:
> > I'm afraid it's not the right approach. The value_type of a constant
> > iterator to T should just be T, not const T. You need to arrange for
> T
> > const* and T const& pointer and reference parameters, respectively.
> >
> >
>
> Thanks, Dave.
>
> Here is an alternative fix:
>
> > cvs diff iterator_adaptors.hpp
> Index: iterator_adaptors.hpp
> ===================================================================
> RCS file: /cvsroot/boost/boost/boost/iterator_adaptors.hpp,v
> retrieving revision 1.42
> diff -r1.42 iterator_adaptors.hpp
> 928a929
> >
> 931c932,944
> < inline typename indirect_iterator_generator<OuterIterator>::type
> ---
> > struct indirect_iterator_selector {
> > typedef typename
> detail::iterator_traits<OuterIterator>::value_type OuterValue;
> > enum { inner_is_const = is_const<typename
> remove_pointer<OuterValue>::type>::value };
> > typedef typename
> boost::detail::if_true<(inner_is_const)>::template
> > then<
> > indirect_iterator_pair_generator<OuterIterator>::const_iterator,
> > // else
> > indirect_iterator_pair_generator<OuterIterator>::iterator
> > >::type type;
> > };
> >
> > template <class OuterIterator>
> > inline typename indirect_iterator_selector<OuterIterator>::type
> 934,935c947
> < typedef typename indirect_iterator_generator
> < <OuterIterator>::type result_t;
> ---
> > typedef typename indirect_iterator_selector<OuterIterator>::type
> result_t;
>
> make_indirect_iterator is inside #ifndef BOOST_MSVC which
> probably means that it is not supposed to be portable to
> that platform to begin with.
>
>
> Info: http://www.boost.org Unsubscribe:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


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