function_ref에 대한 연역 가이드std::function_ref
From ko.cppreference.net
| 헤더 <functional>
|
||
template< class F >
function_ref( F* ) -> function_ref<F>;
|
에 정의됨 (1) | (C++26부터) |
template< auto f >
function_ref( std::nontype_t<f> ) -> function_ref</*see below*/>;
|
(2) | (C++26부터) |
template< auto f, class T >
function_ref( std::nontype_t<f>, T&& ) -> function_ref</*see below*/>;
|
(3) | (C++26부터) |
1) 이 오버로드는
std::is_function_v<F>가 true인 경우에만 오버로드 해결에 참여합니다.2) 타입
F를 std::remove_pointer_t<decltype(f)>이라고 합시다. 이 오버로드는 std::is_function_v<F>가 true인 경우에만 오버로드 해결에 참여합니다. 연역된 타입은 std::function_ref<F>입니다.3) 타입
F를 decltype(f)이라고 합시다. 이 오버로드는 다음 조건에서만 오버로드 해결에 참여합니다 :
F가 형태R(G::*)(A...) noexcept(E)(선택적으로 cv-한정됨, 선택적으로 noexcept, 선택적으로 lvalue 참조 한정됨)이고 타입이G인 경우, 또는F가 형태M G::*이고 타입이G, 객체 타입이M인 경우, 이때R를std::invoke_result_t<F, T&>으로,A...를 빈 팩으로,E를 false로 둡니다, 또는F가 형태R(*)(G, A...) noexcept(E)이고 타입이G인 경우.
- 연역된 타입은
std::function_ref<R(A...) noexcept(E)>입니다.
- 연역된 타입은
예제
|
이 섹션은 불완전합니다
이유: 예제가 없음 |