0

I'm handling with some multiplatform legacy code, and there is a requirement that should compile on Visual Studio 2005.

VS 2005 supports C++11?

Victor
  • 8,309
  • 14
  • 80
  • 129

1 Answers1

1

No it doesn't.

VS2008 has TR1 (assuming sufficient service packs), which are some new components of the standard library like std::tr1::shared_ptr that have made their way into the standard with C++11, but it does not have new language features like lambdas, rvalue references, etc. or library features like threading or std::unique_ptr.

You can get the same effect in VS2005 with Boost's TR1 library. Then if you want cross-compiler support, you can do, e.g.,

#include <boost/tr1/memory.hpp>

int main()
{
    std::tr1::shared_ptr<int> pi( new int(42) );
    // ...
}

On platforms with their own TR1 implementations, Boost will use those automatically. On platforms without TR1, it will use its own implementation, imported into the std::tr1 namespace.

metal
  • 6,202
  • 1
  • 34
  • 49
  • Thanks! It was the answer that I need. For now I don't need to compile in VS2005. Maybe I can compile on VS2010. But I need to wait the Windows developement turn. I'm trying to persuade to abandon VS2005! :) – Victor Jan 09 '14 at 15:39
  • 1
    FWIW, Here's a list of [C++11 support in VS compilers from 2010 up](http://msdn.microsoft.com/en-us/library/hh567368.aspx). – metal Jan 09 '14 at 16:37
  • The feature I'm using is only supported on VS2013! Microsoft is not a good choice! :( – Victor Jan 09 '14 at 17:21