(screenshot from http://www.cplusplus.com/reference/vector/vector/size/)
therefore
assert (vec.size() > -1);
will always fail, since -1 is upgraded to unsigned int type in implicit conversion during comparision and becomes the largest unsigned int.
Suggestion: when checking error input, use closed conditions instead of open conditions, which are common to iteration termination.
i.e.
assert(vec.size() >= 0);
and
for large container use:
unsigned int nSize = vec.size(); //since int and unsigned are of the same length and the size cannot be negative. int nSize can give correct comparision result to other int, but negative region is rather pointless.
Be aware!