resizing containers from static capacity

so I have a list that I initialize with capacity of 100 and write stuff to it. Not all of the indices are filled so I thought that I could do:

 
  myList.resize(myList.size());


I'm probably wrong but, I thought size() should return the amount of ELEMENTS (not max capacity) of my list, which should then be passed to resize() which will resize my list to include just enough space so that there is no excess - but it seems that the size isn't being altered at all? What's wrong with my syntax?
If you set the size of the list to 100 it means it will contain 100 elements. There are no "empty" positions in there.
Topic archived. No new replies allowed.