title: Iterator for vector of pointers that returns a reference
body: <p>I am writing a non-owning wrapper class for a list of objects. Using a list of pointers internally seems to make the most sense for my situation so my class looks something like this:</p>
  <pre><code>class MyWrapper {
      std::vector&lt;MyObject *&gt; m_objs;
  };
  </code></pre>
  <p>Now I want the wrapper to be iterable and since I don't want to write my own iterator-type, I'm reusing the vector's one:</p>
  <pre><code>class MyWrapper {
      std::vector&lt;MyObject *&gt; m_objs;
      
      std::vector&lt;MyObject *&gt;::iterator begin();
      std::vector&lt;MyObject *&gt;::iterator end();
  };
  </code></pre>
  <p>The problem with this approach is that this will of course yield an iterator that will produce a pointer-type when dereferenced. However I would like to let the iterator dereference to a reference of the underlying object though.</p>
  <p>So essentially I want an iterator that dereferences the pointer it is pointing to and thus instead of returning the pointer, it will return a reference to the underlying object. In code:</p>
  <pre><code>MyObject &amp;test = *it;
  </code></pre>
  <p>Is there some iterator-magic that I can play here that lets me achieve something like this without having to write a custom iterator?</p>