vectorlt;intgt;::size_type in C++(C++中的vectorint::size_type)
问题描述
这个 C++ 语句是什么意思?
What is meant by this C++ statement?
vector<int>::size_type x;
而且,这里的作用域运算符 :: 有什么用?换句话说,我们如何用英语阅读这个声明?
And, what is the use of the scope operator :: here? In other words, how do we read this statement in English?
例如对于X::x(){...},我们说x()是一个成员函数class X.
For example, for X::x(){...}, we say that x() is a member function of class X.
推荐答案
size_type 是 vectorstd::size_t 的 typedef,它本身通常是 unsigned int 的 typedef 或unsigned long long.
size_type is a (static) member type of the type vector<int>. Usually, it is a typedef for std::size_t, which itself is usually a typedef for unsigned int or unsigned long long.
这篇关于C++中的vector<int>::size_type的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:C++中的vector<int>::size_type
基础教程推荐
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 初始化列表*参数*评估顺序 2021-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- CString 到 char* 2021-01-01
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
