title: When I include a class such as <vector> and only use 1 or 2 of its member functions, what does the compiler do?
body: <p>Let's say I have a program like the following: </p>
  
  <pre><code>#include &lt;vector&gt;
  #include &lt;iostream&gt;
  
  int main()
  {
     std::vector&lt;int&gt; V; 
     V.push_back(69);
     std::cout &lt;&lt; *V.begin();
     return 0;
  }
  </code></pre>
  
  <p>I've only used 2 functions from the <code>vector</code> class, meaning there is a lot of things unused from that gigantic class. Does my compiler somehow create a <code>vector</code> object that has been stripped of a ton of its functions??? Or does my compiler think, "<em>Oh, all he's doing is printing an integer, so I don't even need to import the <code>vector</code> class</em>." I want to understand what happens on a machine level when I write the above code. </p>