Boost logo

Boost Users :

Subject: Re: [Boost-users] cycle iterators
From: Neal Becker (ndbecker2_at_[hidden])
Date: 2009-09-02 22:15:25


er wrote:

>
>> Can you provide an example of use that shows the problem/error?
>
> Here's an excerpt from the example given in one of my previous replies
> to this post:
>
> typedef cycle_iterator<base_it_,size_> it_;
> it_ it(boost::begin(vec),boost::end(vec),0);
> it_ it2;
> it2 = it;
>
>
>
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/debug/safe_iterator.h:162:
> error: attempt to copy from a singular iterator.

Interesting. This example, which I think is equivalent to yours, compiles
fine with gcc-4.4.1:
(I'm afraid I don't know what the above error means)

#include "cycle_iterator.hpp"
#include <vector>

int main() {
  std::vector<int> v;
  typedef boost::cycle_iterator<std::vector<int>::iterator,size_t> it_;
  it_ it (v.begin(), v.end(), 0);
  it_ it2;
  it2 = it;
}


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