vector::size()
is of type size_t
which is an unsigned type, and unsigned integers can’t represent negative numbers.
More Related Contents:
- Does clearing a vector affect its capacity?
- What is a vector of vector of point? [closed]
- How do I print out the contents of a vector?
- How to convert vector to array
- std::vector::resize() vs. std::vector::reserve()
- Is std::vector so much slower than plain arrays?
- How do I erase an element from std::vector by index?
- Remove elements of a vector inside the loop
- C++ Erase vector element by value rather than by position? [duplicate]
- Convert a vector to a string
- Vectors, structs and std::find
- iterate vector, remove certain items as I go
- Is a moved-from vector always empty?
- How do I print the elements of a C++ vector in GDB?
- How is a vector’s data aligned?
- What’s faster, iterating an STL vector with vector::iterator or with at()?
- Template within template: why “`>>’ should be `> >’ within a nested template argument list”
- What are the Issues with a vector-of-vectors?
- Cleaning up an STL list/vector of pointers
- How to read / write a struct in Binary Files?
- Optimization of raw new[]/delete[] vs std::vector
- What should std::vector::data() return if the vector is empty?
- std::vector reserve() and push_back() is faster than resize() and array index, why?
- Vector Iterators Incompatible
- Why the libc++ std::vector internally keeps three pointers instead of one pointer and two sizes?
- How can I resize a 2D vector of objects given the width and height?
- Is it more efficient to copy a vector by reserving and copying, or by creating and swapping? [duplicate]
- How to use new std::byte type in places where old-style unsigned char is needed?
- How to erase & delete pointers to objects stored in a vector?
- C++ trying to swap values in a vector