template<class T1, class T2> pair(T1, T2) -> pair<T1, T2>; |
|
(C++17 起) |
| | |
為 std::pair 提供了一個推導指南,用於處理隱式推導指南遺漏的邊緣情況,特別是不可複製的引數和陣列到指標的轉換。
[編輯] 示例
#include <utility>
int main()
{
int a[2], b[3];
std::pair p{a, b}; // explicit deduction guide is used in this case
}