Namespaces
Variants

std:: common_reference_with

From cppreference.net
헤더에 정의됨 <concepts>
template < class T, class U >

concept common_reference_with =
std:: same_as < std:: common_reference_t < T, U > , std:: common_reference_t < U, T >> &&
std:: convertible_to < T, std:: common_reference_t < T, U >> &&

std:: convertible_to < U, std:: common_reference_t < T, U >> ;
(C++20부터)

common_reference_with<T, U> 개념은 두 타입 T U 공통 참조 타입 ( std::common_reference_t 에 의해 계산됨)을 공유하며, 둘 다 이 타입으로 변환될 수 있음을 명시합니다.

의미론적 요구사항

T와 U는 다음 조건을 만족할 때만 std :: common_reference_with < T, U > 개념을 모델합니다: 등식 보존 표현식 t1 , t2 , u1 u2 가 주어졌을 때, decltype ( ( t1 ) ) decltype ( ( t2 ) ) 가 모두 T 이고, decltype ( ( u1 ) ) decltype ( ( u2 ) ) 가 모두 U 인 경우,

다시 말해, 공통 참조 타입으로의 변환은 equality를 보존 해야 합니다.

참고문헌

  • C++23 표준 (ISO/IEC 14882:2024):
  • 18.4.5 컨셉트 common_reference_with [concept.commonref]
  • C++20 표준(ISO/IEC 14882:2020):
  • 18.4.5 Concept common_reference_with [concept.commonref]

참고 항목

여러 타입들의 공통 참조 타입을 결정합니다
(클래스 템플릿)
두 타입이 공통 타입을 가짐을 명시합니다
(컨셉)
여러 타입들의 공통 타입을 결정합니다
(클래스 템플릿)