Previously the iterators of boost::container::deque would assert when
zero was added to them in at least the following situations:
- The iterator was obtained by a call to boost::container::deque::begin
and boost::container::deque::empty returns true
- The iterator was default constructed
This is inconsistent with the way in which the iterators of boost::
container::deque have behaved historically and is also inconsistent
with an understanding of iterators developed by analogy with pointers:
- Adding zero to a null pointer is valid despite the fact the null
pointer cannot be dereferenced
- Adding zero to a pointer that is one past the end yields a pointer
which is still one past the end and thus which has well defined
semantics
Fixed this issue and codified the expected behavior in unit tests.
- Avoid deriving from std::iterator_traits as iterators become too fat.
- Use intrusive's reverse_iterator some std::reverse_iterator-s don't value initialize base.