Posted 21 July 2012 - 08:21 AM
Still a good idea to have that check, even if you are certain it wont call an empty vector... if you are concerned that it merely hides bad code you could add a error conditon so it notifies / logs the fact a call to the vector was made even though its empty.
if vector is not empty - do stuff - else - report attempt to access empty vector.
At least you will know that you were somehow accessing a empty vector, I use that a lot and it saves me quiet a lot of headaches.
I find a lot of time when programming I think something should do xyz, and never abc but due to silly faults what I get is abc, and as I have convinced myself the result cant be abc I cant work out why the code isnt working... if I set up my code to report back ( usually a text msg on screen, or a pass a msg to a vector I use to store msgs and display them in a console like function ), I can see what it is actually doing, rather than what I think it should be doing.