title: Getting value of std::list<>::iterator to pointer?
body: <p>How can i loop thru a stl::List and store the value of one of the objects for use later in the function?</p>
  
  <pre><code>Particle *closestParticle;
  for(list&lt;Particle&gt;::iterator p1 = mParticles.begin(); p1 != mParticles.end(); ++p1 )
       {
        // Extra stuff removed
              closestParticle = p1; // fails to compile (edit from comments)
       }
  </code></pre>