vector::size() actually returns size_t, which is exactly the right way to go about, because why should a size() function be able to ever return negative numbers?
Good point about size_t, although technically it's std::size_t.
I agree, STL has done the "right" thing with sizes; of course negative sizes are meaningless. The problem is, Qt's way is so much nicer to use, even though it is obviously "wrong." Type three characters, done. Putting "int" in your headers, it's obvious what's going on--you're getting a number back. I suppose std::size_t is obvious, but it's hard to read, and I hate typing underscores. Again, more correct, but I hate doing it, which is just another reason why Qt is such fun to use compare to STL.
I agree, STL has done the "right" thing with sizes; of course negative sizes are meaningless. The problem is, Qt's way is so much nicer to use, even though it is obviously "wrong." Type three characters, done. Putting "int" in your headers, it's obvious what's going on--you're getting a number back. I suppose std::size_t is obvious, but it's hard to read, and I hate typing underscores. Again, more correct, but I hate doing it, which is just another reason why Qt is such fun to use compare to STL.