std::pair
来自cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <utility>
|
||
| template< class T1, |
||
std::pair是一个结构模板,提供了一种方法来存储两个异构对象作为一个单元.Original:
std::pair is a struct template that provides a way to store two heterogeneous objects as a single unit.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目录 |
[编辑] 会员类型
| 会员类型
Original: Member type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
first_type
|
T1
|
second_type
|
T2
|
[编辑] 会员对象
| 会员名称
Original: Member name The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Type |
first
|
T1
|
second
|
T2
|
[编辑] 成员函数
| 构建了一双新的 Original: constructs new pair The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 分配的内容 Original: assigns the contents The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| (C++11) |
交换的内容 Original: swaps the contents The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) |
[编辑] 非成员函数
| 创建一个 pair对象的类型,定义的参数类型Original: creates a pair object of type, defined by the argument typesThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数模板) | |
| 字典顺序比较的值中的一对 Original: lexicographically compares the values in the pair The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数模板) | |
| (C++11) |
专业的std::swap算法 Original: specializes the std::swap algorithm The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数模板) |
| (C++11) |
访问一个一个 pair元素 Original: accesses an element of a pair The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数模板) |
[编辑] Helper类
| (C++11) |
获得一个 pair大小 Original: obtains the size of a pair The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (类模板专业化) |
pair的元素获得的类型 Original: obtains the type of the elements of pair The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (类模板专业化) | |