Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

C++ TR1 in Visual Studio 2008

📅 2012-Jun-13 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

If you are stuck with Visual Studio 2008 for some reason and need to compile C++ code that is using C++11 features like random or unordered_set, then the TR1 may be an option for you. TR1 is an early draft of the features that were later incorporated into C++11. To get TR1 for Visual Studio 2008, download the Visual C++ 2008 Feature Pack Release from here.

Note that, the namespace for the TR1 features will be std::tr1. For example, std::unordered_set needs to be called as std::tr1::unordered_set. A minor inconvenience, but easy to find and replace in the code.