title: std::vector crash?
body: <p>Wrote a small program to test vectors and I don't understand why this is crashing, could someone help?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;algorithm&gt;
  #include &lt;vector&gt;
  
  void print(int* i)
  {
          std::cout &lt;&lt; i &lt;&lt; std::endl;
  }
  
  int main()
  {
          std::vector&lt;int*&gt;* intPtr;
  
          intPtr-&gt;push_back(new int(1));
          intPtr-&gt;push_back(new int(2));
          intPtr-&gt;push_back(new int(3));
  
          std::for_each(intPtr-&gt;begin(), intPtr-&gt;end(), print);
  }
  </code></pre>
  
  <p>Ignore the memory leaks for now, this was just a quick example.</p>