template<class T>
struct output_iterator_wrapper: public std::iterator
<std::output_iterator_tag, T, ptrdiff_t, T*, T&>
{
// ...
WritableObject<T>
operator*() const
{
ITERATOR_VERIFY(ptr < SharedInfo->last);
ITERATOR_VERIFY(SharedInfo->writtento[ptr - SharedInfo-
>first] == false);
return WritableObject<T>(ptr, SharedInfo);
}
// ...
};
output_iterator_wrapper<T>::reference is defined to be T&, whereas
operator* returns WritableObject<T>. Sure, you won't find anywhere
in the standard that explicitly says that the "reference" type
needs to be the same as the return type of operator*, but it's
implied by the uses of "reference" (e.g., in reverse_iterator).
Anyway, I doubt the current output_iterator_wrapper would pass a
concept checker, and it fails in ConceptGCC.
I suggest changing the last argument of the std::iterator base to
WritableObject<T>. Patch attached.