How to start using tr1 functions in Visual Studio 2010? For a more specific case, I need the function std :: tr1 ::. I tried to include #include <tr1/functional> , which reports that it is missing, and #include <functional> includes a penalty, but when I installed this:
std::tr1::function<void(void)> callback;
I get:
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 ';'
If I use boost, it works fine, but for this project, due to the use of a certain structure, I will need the tr1 version for Visual Studio.
As suggested, skipping tr1 will still return the same result:
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 ';'
c ++ c ++ 11 std visual-studio-2010 tr1
Speed
source share