title: Apparent inconsistency in iterator requirements
body: <p>I am implementing some type-traits/concept classes to check that a type passed to a generic function satisfies the compile-time requirements for iterator types (as defined in the standard, starting from 24.2.2).</p>
  
  <p>The problem is that a basic iterator requirement (Table 106) is that the type of <code>*r</code> (where <code>r</code> is a reference to an iterator of type <code>T</code>) is <code>std::iterator_traits&lt;T&gt;::reference</code>. However, if we consider an output iterator such as <code>std::ostream_iterator</code>,</p>
  
  <p><a href="http://en.cppreference.com/w/cpp/iterator/ostream_iterator" rel="nofollow">http://en.cppreference.com/w/cpp/iterator/ostream_iterator</a></p>
  
  <p>we can see how in this case the <code>reference</code> type is <code>void</code>, whereas the <code>operator*()</code> of the iterator type returns <code>std::ostream_iterator &amp;</code>.</p>
  
  <p>Clearly, I am misunderstanding something here, but I can't see what? Does it have anything to do with the fact that output iterators can be dereferenced only on the left side of an assignment?</p>
  
  <p>EDIT: I would like to clarify that my question is about the inconsistency between the reference type and the type resulting from calling <code>operator*()</code> on <code>std::ostream_iterator</code> (and a bunch of other output iterators in the standard library).</p>