Where can I look up the definition of size_type for vectors in the C++ STL?

前端 未结 7 1277
暗喜
暗喜 2021-01-12 21:15

It seems safe to cast the result of my vector\'s size() function to an unsigned int. How can I tell for sure, though? My documentation isn\'t cle

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-12 21:41

    As long as you're sure that an unsigned int on your system will be large enough to hold the number of items you'll have in the vector you should be safe ;-)

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题