How does one start using the tr1 features of Visual Studio 2010? For a more specific case, I require the std::tr1::function. I tried including #include <tr1/functional>
which reports as missing, while #include <functional>
includes fine, but when I set 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, because of using a specific framework I'd require the Visual Studio tr1 version.
As suggested, skipping the tr1, still returns 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 ';'
tr1
stands for Technical Report 1 which was a list of proposed additions to the C++ Standard. Once the proposals were accepted, thetr1
designation became obsolete. – Juneinclude <functional>
? – Etaminestd::function
, and notstd::functional
? – Joaquin#define std _STL
somewhere? Because that error makes no sense for the code you've shown. – Kohnstd
as a variable of type_STL
. – Etaminestd::function
. If so, you know it's a header causing the problem. – Etaminestd
, that means someone, somewhere already does#define std
. Put#undef std
after your includes, then find and shoot whoever definedstd
as a macro. – Kohn#undef std
? – Kohnfunctional
issue? – EtamineMarmalade
provide it's own standard library? I think it does. That would explain the lack of newer features, likefunction
. – Etamine