3 ms·
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
by eps 11y ago
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?
- prewett 11y agoGood 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.
- deleted 11y ago[deleted]
- deleted 11y ago[deleted]