Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-04-11 19:29:52


From: "Ivan Nincic" <ivann_at_[hidden]>

> Is iterator_adaptor<int, itrpolicy, MyType> legal?

In principle it should be legal, depending on what itrpolicy and MyType
are. However, msvc6 may not be smart enough to deduce the correct types
for all of the optional template parameters

> I get compile time errors using VC6.0
>
> error C2039: 'difference_type' : is not a member of '`global
namespace''
> boostlib\boost\detail\iterator.hpp(299) : see reference to
class
> template instantiation
> 'boost::detail::iterator_traits_::msvc_traits_select<0>::traits_<int>'
being
> compiled
> ... + 14 more.
>
> If I use iterator_adaptor<int*, itrpolicy, MyType> the code compiles
without
> a problem.
>
> I want to create a new iterator type and do not want to wrap an
existing
> iterator. Can I use iterator_adaptor for this?

Yes. counting_iterator_adaptor<int> is an example of an iterator_adaptor
instantiation which creates a brand new iterator using int as the first
parameter (it works with msvc6, too).

-Dave


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