Boost logo

Boost Users :

Subject: Re: [Boost-users] Implementing python's enumerate with iterator adaptors
From: Jens Auer (jensa_at_[hidden])
Date: 2012-04-18 03:11:02


Von: boost-users-bounces_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] Im Auftrag von Jeffrey Lee Hellrung, Jr.
1> My guess is this is where that proxy reference bites you, as it makes your Enumerator iterator not strictly a random access iterator, even though it morally is, so boost::iterator_facade won't set your 1> iterator_category to std::random_access_iterator_tag and instead tries to go a middle-of-the-road approach (IIRC). Try typedef'ing
1>
1> typedef std::random_access_iterator_tag iterator_category; // I think this is right...
1>
1> in your Enumerator definition and see if MSVC complains?

Hi Jeff,

this fixed the problem and now it compiles, although I would prefer
typedef typename Iterator::iterator_category iterator_category;

to make the Enumerator the same category as the underlying iterator.

Thanks,
  Jens


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net