5
A
答えて
3
どの程度
using my_function_type = std::function<void(int)>;
+0
VS2012が機能しません! – linquize
+0
@linquize次に、 'typedef'を使います。 –
7
あなたは正確なタイプを取得するためにdecltype
を使用することができます。
auto fn = [&] (int x) { doSomething(x, 3); };
using lambda_type = decltype(fn);
をしかし、あなたは単に互換、より一般的なタイプをお知りになりたい場合は、ラムダを別の関数の引数として渡すと言うと、std::function<void(int)>
(Jo achimが言及する)。
1
typedef std::function<void(int)> my_function_type;
VS2012
関連する問題
- 1. C++単純参照型関数
- 2. 定数参照 - C++
- 3. 未定義参照
- 4. C++ 11:GCC 4.8静的thread_local std :: unique_ptr未定義参照
- 5. 未定義参照
- 6. 未定義参照
での作品は、このヘルプはhttp://stackoverflow.com/questions/4295432/typedef-function-pointerていますか? – Chemistpp