Boost logo

Boost Users :

Subject: Re: [Boost-users] [mpl] Iterator Concept Checking?
From: David Abrahams (dave_at_[hidden])
Date: 2010-11-03 21:40:50


At Sun, 31 Oct 2010 18:16:21 -0400,
Stirling Westrup wrote:
>
> This is the big kicker for me. As far as I can tell from the
> documents, there are only three requirements, and two (for deref and
> next) don't apply to past-the-end iterators.

Then, if I were you, I would actually be checking for valid pairs of
iterators. If they're unequal, you can look for deref and next on the
first iterator.

> Since I need
>
> BOOST_MPL_ASSERT(( is_forward_iterator<end<Sequence>::type> ))
>
> to succeed,

It looks like you're talking about a trait to distinguish iterator
categories. Concept checking, as classically practiced, is about
generating errors. I realize that you have a BOOST_MPL_ASSERT in that
example, but if you actually require that the above code works, then
you need to be able to detect the category without generating errors.
So, which one are you after?

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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