Visual Studio 2010のtr1機能の使い方を教えてください。もっと具体的には、std :: tr1 ::関数が必要です。私は#include <functional>
は罰金含んでいるが、不足していると報告し#include <tr1/functional>
含めてみましたが、私は、この設定した場合:tr1をVisual Studio 2010(tr1 :: function)で使用する方法は?
std::tr1::function<void(void)> callback;
を私が取得:私はブーストを使用している場合は、それがこのプロジェクトのために正常に動作しますが、
1>d:\marmalade\projects\core\src\button.h(21): error C3083: 'tr1': the symbol to the left of a '::' must be a type
1>d:\marmalade\projects\core\src\button.h(21): error C2039: 'function' : is not a member of '_STL'
1>d:\marmalade\projects\core\src\button.h(21): error C2143: syntax error : missing ';' before '<'
1>d:\marmalade\projects\core\src\button.h(21): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\marmalade\projects\core\src\button.h(21): error C2238: unexpected token(s) preceding ';'
特定のフレームワークを使用しているため、Visual Studio tr1バージョンが必要です。
としては、提案TR1をスキップし、それでも同じ結果を返します。デフォルトでは有効になってC++ 11と
std::function<void(void)> callback;
1>d:\marmalade\projects\core\src\button.h(20): error C2039: 'function' : is not a member of '_STL'
1>d:\marmalade\projects\core\src\button.h(20): error C2143: syntax error : missing ';' before '<'
1>d:\marmalade\projects\core\src\button.h(20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\marmalade\projects\core\src\button.h(20): error C2238: unexpected token(s) preceding ';'
tr1は、[技術レポート1](http://en.wikipedia.org/wiki/C%2B%2B_Technical_Report_1)の略で、C++標準への追加提案のリストです。提案が受け入れられると、 'tr1'指定は廃止されました。 –
あなたは ''を含めましたか? –
はい、私はそれを含めました。 – Speed