如何开始使用Visual Studio 2010的tr1功能?对于更具体的情况,我需要std :: tr1 :: function.我试过包括#include< tr1 / functional>报告为缺失,而#include< functional>包括罚款,但当我设置这个:
std::tr1::function 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 ';'
如果我使用boost,它工作正常,但对于这个项目,由于使用特定的框架,我需要Visual Studio tr1版本.
正如所建议的那样,跳过tr1仍会返回相同的结果:
std::function 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 ';'