Namespaces
Variants

deduction guides for std::reference_wrapper

From cppreference.net
Utilities library
Function objects
Function invocation
(C++17) (C++23)
Identity function object
(C++20)
Old binders and adaptors
( until C++17* )
( until C++17* )
( until C++17* )
( until C++17* )
( until C++17* ) ( until C++17* ) ( until C++17* ) ( until C++17* )
( until C++20* )
( until C++20* )
( until C++17* ) ( until C++17* )
( until C++17* ) ( until C++17* )

( until C++17* )
( until C++17* ) ( until C++17* ) ( until C++17* ) ( until C++17* )
( until C++20* )
( until C++20* )
헤더 파일에 정의됨 <functional>
template < typename T >
reference_wrapper ( T & ) - > reference_wrapper < T > ;
(C++17부터)

하나의 deduction guide std::reference_wrapper 에 제공되어 단일 클래스 템플릿 매개변수의 추론을 지원합니다.

예제

결함 보고서

다음의 동작 변경 결함 보고서들은 이전에 발표된 C++ 표준에 소급 적용되었습니다.

DR 적용 대상 게시된 동작 올바른 동작
LWG 2981 C++17 reference_wrapper<T> 에서 중복된 deduction guide가 제공됨 제거됨
LWG 2993 C++17 결함 해결이 클래스 템플릿 인수 deduction에 사용되던 생성자를 제거함 이를 보완하기 위해 deduction guide 추가됨