std::experimental::invocation_type, std::experimental::raw_invocation_type
來自 cppreference.com
定義於標頭檔案 <experimental/type_traits> |
||
template< class > struct raw_invocation_type; //未定義 |
(1) | (庫基礎 TS) |
template< class > struct invocation_type; //未定義 |
(2) | (庫基礎 TS) |
計算當 Fn
與引數 ArgTypes...
一起呼叫時的*呼叫引數*,如 INVOKE(std::declval<Fn>(), std::declval<ArgTypes>()...),其中 INVOKE 是在 Callable 中定義的操作。
表示式 INVOKE(f, t1, t2, ..., tN) 的*呼叫引數*定義如下,其中 T1
是 t1
的(可能是 cv-限定的)型別,如果 t1
是左值,則 U1
是 T1&
,否則是 T1&&
。
- 如果
f
是類T
的成員函式指標,則呼叫引數為U1
,後跟由t2, ..., tN
匹配的f
的引數。 - 如果
N == 1
且f
是類T
的成員資料指標,則呼叫引數為U1
。 - 如果
f
是類型別物件,則呼叫引數是在f
的函式呼叫運算子和代理呼叫函式中,與引數t1, ..., tN
匹配的最佳可行函式的引數。 - 在所有其他情況下,呼叫引數是
f
的引數中與t1, ..., tN
匹配的引數。
如果引數 tI
與函式引數列表中的省略號匹配,則相應的呼叫引數是對 tI
應用預設引數提升的結果。
Fn
和 ArgTypes
中的所有型別可以是任何完整型別、未知邊界陣列或(可能是 cv-限定的)void
。
目錄 |
[編輯] 成員型別
成員型別 | 定義 |
raw_invocation_type<Fn(ArgTypes...)>::type | R(T1, T2, ...),其中
僅當 |
invocation_type<Fn(ArgTypes...)>::type | R(U1, U2, ...),其中
僅當 |
[編輯] 輔助型別
template< class T > using raw_invocation_type_t = typename raw_invocation_type<T>::type; |
(庫基礎 TS) | |
template< class T > using invocation_type_t = typename invocation_type<T>::type; |
(庫基礎 TS) | |
[編輯] 示例
本節不完整 原因:無示例 |
[編輯] 另請參閱
C++ 文件,關於 反射 TS
|