title: Dynamic cast to vector iterator
body: <p>I have below snippet-</p>
  
  <pre><code>std::vector&lt;cMyClass&gt; myCls = GetClassValues();
  std::vector&lt;cMyClass&gt;::const_iterator imyCls;
  for( imyCls = myCLs.begin(); imyCls != myCls.end(); ++imyCls)
  {
    cMyClass *cls = dynamic_cast&lt;cMyClass*&gt;(*imyCls);//C2682
  
  
  }
  </code></pre>
  
  <p>In for loop I want to have pointer variable of cMyClass, I can't use direct assignment or static cast. SO using dynamic_cast but that also doesn't seem to be working.</p>
  
  <p>What option I have if I want to make it working.</p>