cplusplus
.com
教程
參考
文章
論壇
C++
教程
參考
文章
論壇
參考
C 庫
<cassert> (assert.h)
<cctype> (ctype.h)
<cerrno> (errno.h)
C++11
<cfenv> (fenv.h)
<cfloat> (float.h)
C++11
<cinttypes> (inttypes.h)
<ciso646> (iso646.h)
<climits> (limits.h)
<clocale> (locale.h)
<cmath> (math.h)
<csetjmp> (setjmp.h)
<csignal> (signal.h)
<cstdarg> (stdarg.h)
C++11
<cstdbool> (stdbool.h)
<cstddef> (stddef.h)
C++11
<cstdint> (stdint.h)
<cstdio> (stdio.h)
<cstdlib> (stdlib.h)
<cstring> (string.h)
C++11
<ctgmath> (tgmath.h)
<ctime> (time.h)
C++11
<cuchar> (uchar.h)
<cwchar> (wchar.h)
<cwctype> (wctype.h)
容器
C++11
<array>
<deque>
C++11
<forward_list>
<list>
<map>
<queue>
<set>
<stack>
C++11
<unordered_map>
C++11
<unordered_set>
<vector>
輸入/輸出
<fstream>
<iomanip>
<ios>
<iosfwd>
<iostream>
<istream>
<ostream>
<sstream>
<streambuf>
多執行緒
C++11
<atomic>
C++11
<condition_variable>
C++11
<future>
C++11
<mutex>
C++11
<thread>
其他
<algorithm>
<bitset>
C++11
<chrono>
C++11
<codecvt>
<complex>
<exception>
<functional>
C++11
<initializer_list>
<iterator>
<limits>
<locale>
<memory>
<new>
<numeric>
C++11
<random>
C++11
<ratio>
C++11
<regex>
<stdexcept>
<string>
C++11
<system_error>
C++11
<tuple>
C++11
<type_traits>
C++11
<typeindex>
<typeinfo>
<utility>
<valarray>
<utility>
類
pair
函式
C++11
declval
C++11
forward
make_pair
C++11
move
C++11
move_if_noexcept
C++11
swap
型別
C++11
piecewise_construct_t
常量
C++11
piecewise_construct
名稱空間
rel_ops
pair
pair::pair
成員函式
pair::operator=
C++11
pair::swap
非成員過載
C++11
get (pair)
relational operators (pair)
C++11
swap (pair)
非成員特化
C++11
tuple_element<pair>
C++11
tuple_size<pair>
參考
<utility>
pair
類模板
<utility>
std::
pair
template <class T1, class T2> struct pair;
值對
此類將一對值組合在一起,它們可以具有不同的型別(
T1
和
T2
)。可以透過其公共成員
first
和
second
訪問單個值。
tuple
的特例是 pair。
模板引數
T1
成員
first
的型別,別名為
first_type
。
T2
成員
second
的型別,別名為
second_type
。
成員型別
成員型別
定義
說明
first_type
第一個模板引數(
T1
)
成員
first
的型別。
second_type
第二個模板引數(
T2
)
成員
second
的型別。
成員變數
成員變數
定義
first
pair
中的第一個值
second
pair
中的第二個值
成員函式
(建構函式)
構造 pair
(public member function)
pair::operator=
賦值內容
(公開成員函式)
pair::swap
交換內容
(公開成員函式)
非成員函式過載
relational operators (pair)
pair 的關係運算符
(函式模板)
swap (pair)
交換兩個 pair 的內容
(函式模板)
get (pair)
獲取元素(tuple 介面)
(函式模板)
非成員類特化
tuple_element<pair>
pair 的 tuple 元素型別
(類模板特化)
tuple_size<pair>
pair 的 tuple 特徵
(類模板特化)
另見
make_pair
構造 pair 物件
(function template)
piecewise_construct
piecewise construct 常量
(常量)