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
> boostlib\boost\detail\iterator.hpp(299) : see reference to
> template instantiation
> 'boost::detail::iterator_traits_::msvc_traits_select<0>::traits_<int>'
> compiled
> ... + 14 more.
> If I use iterator_adaptor<int*, itrpolicy, MyType> the code compiles
> a problem.
> I want to create a new iterator type and do not want to wrap an
> 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).


Boost list run by bdawes at, gregod at, cpdaniel at, john at