Namespaces
Variants

std::common_type<std::pair>

cppreference.com에서
 
 
유틸리티 라이브러리
일반 유틸리티
관계 연산자 (C++20에서 폐지됨)
정수 비교 함수
(C++20)(C++20)(C++20)    
(C++20)
교체 및 타입 연산
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
공통 어휘 타입
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)



 
 
헤더 <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 타입의 공통 타입을 결정합니다
(클래스 템플릿 특수화)