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

前端 未结 7 1344
暗喜
暗喜 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条回答
  •  半阙折子戏
    2021-01-12 21:41

    According to the standard, you cannot be sure. The exact type depends on your machine. You can look at the definition in your compiler's header implementations, though.

提交回复
热议问题