title: What is the use of value_type in STL containers?
body: <p>What's the use of <code>value_type</code> in STL containers?</p>
  <p>From the MSDN:</p>
  <pre><code>// vector_value_type.cpp
  // compile with: /EHsc
  #include &lt;vector&gt;
  #include &lt;iostream&gt;
  
  int main( )
  {
     using namespace std;
     vector&lt;int&gt;::value_type AnInt;
     AnInt = 44;
     cout &lt;&lt; AnInt &lt;&lt; endl;
  }
  </code></pre>
  <p>I don't understand what does <code>value_type</code> achieve here?
  The variable could be an <code>int</code> as well? Is it used because the coders are lazy to check what's the type of objects present in the vector?</p>
  <p>I think these are also similar to it <code>allocator_type</code>,<code>size_type</code>,<code>difference_type</code>,<code>reference</code>,<code>key_type</code> etc..</p>