title: How to iterate through shared_ptr vector
body: <p>I have a vector:</p>
  
  <pre><code>vector&lt;MyClass&gt; database;  
  </code></pre>
  
  <p>and a second one:</p>
  
  <pre><code>vector&lt;shared_ptr&lt;MyClass&gt; &gt; databasePtrs;
  </code></pre>
  
  <p><code>databasePtrs</code> contains pointers to database elements in a certain order. I want to iterate through the pointers using an iterator, not <code>for</code> cycle. But I have no idea how to create the iterator.  The expression:</p>
  
  <pre><code>vector&lt;MyClass&gt;::iterator it;
  </code></pre>
  
  <p>obviously doesn't work, nor do other variants I've tried. </p>