deduction guides for
std::function_ref
From cppreference.net
<
cpp
|
utility
|
functional
|
function ref
C++
Utilities library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Function objects
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Old binders and adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
ヘッダーで定義
<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以降) |
2)
型
F
を
std::
remove_pointer_t
<
decltype
(
f
)
>
とする。このオーバーロードは、
std::
is_function_v
<
F
>
が
true
である場合にのみオーバーロード解決に参加する。推定される型は
std::
function_ref
<
F
>
である。
3)
型
F
を
decltype
(
f
)
とする。このオーバーロードは以下の場合にのみオーバーロード解決に参加する:
- F が型 G に対する形式 R ( G :: * ) ( A... ) noexcept ( E ) である場合(任意でcv修飾、任意でnoexcept、任意で左辺値参照修飾)、または
- F が型 G とオブジェクト型 M に対する形式 M G :: * である場合。この場合、 R を std:: invoke_result_t < F, T & > 、 A... を空のパック、 E をfalseとする、または
- F が型 G に対する形式 R ( * ) ( G, A... ) noexcept ( E ) である場合。
-
- 推論される型は std:: function_ref < R ( A... ) noexcept ( E ) > です。
例
|
このセクションは不完全です
理由: 例がありません |