title: std::find for inherit object c++
body: <p>1.So I have:</p>
  
  <pre><code>Class A;
  
  Class B : public A;
  
  Class C : public B;
  </code></pre>
  
  <p>2.And a vector of pointers of type B:</p>
  
  <pre><code>vector&lt;B*&gt; vec;
  </code></pre>
  
  <p>3.Then:</p>
  
  <pre><code>C* ptr = new C();
  
  vec.push_back(ptr);
  </code></pre>
  
  <p>So the question is, it is reliable to use std::find like this?</p>
  
  <pre><code>std::find(vec.begin(), vec.end(), prt);
  </code></pre>
  
  <p>Also, is it fine to do search using this-> pointer?</p>
  
  <pre><code>std::find(vec.begin(), vec.end(), this); //inside of a type C object
  </code></pre>
  
  <p>Thanks in advance.</p>