關於vector 的size()的返回值的值
官方文檔的解釋如下:
The number of elements in the container.
Member type size_type
is an unsigned integral type.
所以我用int來和unsigned來進行比較的話,可能會出現問題,
這個在C++Primer里面也有講.
大意就是溢出之類的.
不過也可以不用管的講.
The number of elements in the container.
Member type size_type
is an unsigned integral type.
所以我用int來和unsigned來進行比較的話,可能會出現問題,
這個在C++Primer里面也有講.
大意就是溢出之類的.
不過也可以不用管的講.
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。