Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost][DateTime] Non conforming iterators?
From: Arne Vogel (avogel_at_[hidden])
Date: 2015-06-29 05:22:52


Hi,

On 25.06.2015 14:53, dariomt_at_[hidden] wrote:
> Compilation on gcc and clang fails with a similar error complaining
> about the lack of 'difference_type'.
>
> Isn't a nested difference_type a requirement of BidirectionalIterator?

Not entirely. An algorithm should use std::iterator_traits to access
these types. Among other things this will ensure the algorithm works
with pointers. The primary template tries to use nested types within the
iterator's class or struct (if any). It seems that DateTime fails to
provide all types as nested types *and* fails to specialize
std::iterator_traits so it would not have to.

But I must admit I only did a cursory "grep" (v 1.55.0).

> Am I using these date iterators incorrectly?

It looks correct to me though I don't use DateTime a lot. It does seem
the required difference_type is not provided by month_iterator. I'd
suggest you check whether this was reported as a bug before, or maybe
already fixed in the master branch.

> Regards
>

Cheers,
Arne Vogel


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