Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What will happen to namespace tr1 when c++ xx is approved?

Tags:

c++

tr1

I'm writing some stuff using the tr1 namespace in VS2008. What will happen when C++xx becomes ratified? Has this happened before with other C++ revisions? Will the tr1 stuff still work or will I have to change all of my include? I realize that I'm making the very large assumption that this ratification will someday occur. I know that most likely none of you work for MS or contribute to GCC, but if you have experience with these kinds of changes, I would appreciate the advice.

like image 937
Steve Avatar asked Jan 04 '10 22:01

Steve


2 Answers

std::tr1 will become part of std in C++1x (std::tr1::shared_ptr becomes std::shared_ptr, etc). std::tr1 will continue to exist as long as that compiler claims to implement TR1. At some point your compiler may drop that claim, and drop std::tr1 as a result. This probably will never happen.

std::tr1 has already been "copied" into namespace std in Visual Studio 2010 Beta (via a using directive)

like image 188
Terry Mahaffey Avatar answered Oct 06 '22 00:10

Terry Mahaffey


The Wikipedia entry for C++0x says "A large part of the new libraries are defined in the document C++ Standards Committee's Library Technical Report (called TR1), which was published in 2005. Various full and partial implementations of TR1 are currently available using the namespace std::tr1. For C++0x they will be moved to namespace std. However, as TR1 features are brought into the C++0x standard library, they are upgraded where appropriate with C++0x language features that were not available in the initial TR1 version. Also, they may be enhanced with features that were possible under C++03, but were not part of the original TR1 specification."

like image 28
Permaquid Avatar answered Oct 06 '22 01:10

Permaquid