Namespaces
Variants

std:: common_type <std::pair>

From cppreference.net
Utilities library
헤더 파일에 정의됨 <utility>
template < class T1, class T2, class U1, class U2 >

requires requires { typename std:: pair < std:: common_type_t < T1, U1 > ,
std:: common_type_t < T2, U2 >> ; }

struct common_type < std:: pair < T1, T2 > , std:: pair < U1, U2 >> ;
(C++23부터)

pair 의 공통 타입은 두 pair 의 해당 요소 타입들의 공통 타입들로 구성된 pair 입니다.

공통 타입은 두 쌍의 해당 요소 타입 모두가 공통 타입을 가질 경우에만 정의됩니다.

멤버 타입

멤버 타입 정의
type std:: pair < std:: common_type_t < T1, U1 > , std:: common_type_t < T2, U2 >>

예제

참고 항목

여러 타입들의 공통 타입을 결정합니다
(클래스 템플릿)
tuple tuple-like 타입의 공통 타입을 결정합니다
(클래스 템플릿 특수화)