What is wrong in my code?
Qt Code:
  1. #include <QVector>
  2.  
  3. int main()
  4. {
  5. QVector<int> v;
  6. printf("v.size()=%u\n", v.size());
  7. v.reserve(2);
  8. printf("v.size()=%u\n", v.size());
  9. }
To copy to clipboard, switch view to plain text mode 
Result:
Qt Code:
  1. v.size()=0
  2. v.size()=0
To copy to clipboard, switch view to plain text mode 
I expected that reserve() does allocate the required memory, as resize() does, so how does reserve() work actually?