size_type value_type类型:

来源:互联网 发布:人工智能程序 编辑:程序博客网 时间:2024/05/20 18:18

size_type类型:

string类类型和vector类类型定义的类型,用以保存任意string对象或vector对象的长度,标准库类型将size_type定义为unsigned类型

  string抽象意义是字符串, size()的抽象意义是字符串的尺寸, string::size_type抽象意义是尺寸单位类型

string::size_type它在不同的机器上,长度是可以不同的,并非固定的长度。但只要你使用了这个类型,就使得你的程序适合这个机器。与实际机器匹配。

value_type类型:

vector:

The type is a synonym for the template parameter T.

这个类型类似于模版参数T.

set:

The type describes an element of the controlled sequence.

描述控制序列的元素类型

list:

The type is a synonym for the template parameter T.

这个类型类似于模版参数T.

map:

typedef pair<const Key, T> value_type;

The type describes an element of the controlled sequence.

描述控制序列的元素类型

详细请看:

C++ Primer

MSDN