[and...]
> Well, the issue with the "boost::iterator_range" it happens in debug
> mode. I have solved it thus:
>
> #ifdef _DEBUG
> #define _HAS_ITERATOR_DEBUGGING 0
> #endif
>
> #include <string>
> #include <uri/grammar.hpp>
This actually has nothing to do with boost::iterator_range;
_HAS_ITERATOR_DEBUGGING is a symbol used by your (Microsoft) stdlib
implementation.
According to
"…if one creates a default constructed iterator_range, then one can
still call all its member functions."
But that doesn't mean that the member functions are guaranteed to return
valid iterators. And when one is dealing with a default-constructed
iterator_range, I don't see how they could (return valid iterators). So
the exception is thrown when you try to dereference one of the returned
(invalid) iterators.
What happens if you test iterator_range::empty first? The
iterator_range documentation doesn't come out and say that empty is
guaranteed to return "true" for a default-constructed iterator_range;
but the bit I quoted above is very near to that. That is, returning
"false" in this case would be silly; and doing something that causes the
underlying stdlib to throw would be inconsistent with the stated
guarantee.
--
Braden McDaniel <bra...@endoframe.com>