deduction guides for std::pair
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Utilities library
Type support (basic types, RTTI)
Library feature-test macros (C++20)
(C++11)
(C++20)
(C++26)
(C++20)
Coroutine support (C++20)
Contract support (C++26)
(C++20)(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)(C++20)
(C++20)(C++20)(C++20)
General utilities
Relational operators (deprecated in C++20)
(C++20)(C++20)(C++20)
(C++20)(C++20)(C++20)
(C++20)
Swap and type operations
Common vocabulary types
std::pair
(C++11)
(until C++20)(until C++20)(until C++20)(until C++20)(until C++20)(C++20)
(C++11)
(C++11)
(C++11)
(C++11)
(C++23)
(C++23)
(C++11)
Deduction guides(C++17)
Defined in header
<utility>
template<class T1, class T2>
pair(T1, T2) -> pair<T1, T2>;
(since C++17)
pair(T1, T2) -> pair<T1, T2>;
One deduction guide is provided for std::pair to account for the edge cases missed by the implicit deduction guides, in particular, non-copyable arguments and array to pointer conversion.
[edit] Example
Run this code
#include <utility> int main() { int a[2], b[3]; std::pair p{a, b}; // explicit deduction guide is used in this case }