title: stl "vector<T> too long"
body: <p>i read in other answers that theres no limit imposed by c++ compiler <a href="https://stackoverflow.com/questions/6262914/maximum-size-of-stdvector">maximum size of std::vector</a>. i am trying to use vector for one purpose, and in need to have 10^19 items.</p>
  
  <pre><code>typedef struct{
    unsigned long price, weight;
  }product;
  
  
  //inside main
  unsigned long long n = 930033404565174954;
  vector&lt;product&gt; psorted(n);
  </code></pre>
  
  <p>the program breaks on the last statement. if i try <code>resize(n)</code> instead of initializing with <code>n</code> then also program breaks with message :</p>
  
  <pre><code>vector&lt;T&gt; too long
  std::length_error at memory location
  </code></pre>
  
  <p>i need to sort the data accourding to price after putting in vector. what should i do ?</p>