title: How to retreive a specific element from a vector and assign it to a variable?
body: <p>Suppose I have a class called Student with the following value constructor:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>Student::Student(const string &amp;id) : id_(id){}
  </code></pre>
  
  <p>And in the main.cpp I have:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>shared_ptr&lt;Student&gt; s1(new Student("st1"));
  shared_ptr&lt;Student&gt; s2(new Student("st2"));
  shared_ptr&lt;Student&gt; s3(new Student("st3"));
  
  vector&lt;Student&gt; vect;
  
  vect.push_back(s1); 
  vect.push_back(s2); 
  vect.push_back(s3);
  </code></pre>
  
  <p>Then I intend to retreive a student with id "st2" from <code>vect</code> and assign it to a variable, how do I do that?</p>