std::pair is a class template that provides a way to store two heterogeneous objects as a single unit. A pair is a specific case of a std::tuple with two elements.
This is the only non-default constructor that can be used to create a pair of non-copyable non-movable types. The program is ill-formed if first or second is a reference and bound to a temporary object.
Creates a std::pair object, deducing the target type from the types of arguments.
The common reference type of two pair s is a pair of both common reference types of corresponding element types of both pair s, where the cv and reference qualifiers on the pair s are applied to their element types. The common reference type is defined only if both pairs of corresponding element types have common reference types.
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.