tags:

views:

376

answers:

3

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.

+1  A: 

tr1 is not part of any standard (the paper it is shorthand for never was accepted) - it's just a convention that some compilers provide. They will almost certainly go on providing it long into the future.

anon
+6  A: 

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."

Permaquid
And now people are getting upvotes for providing answers that are verbatim quotes from Wikipedia - way to go!
anon
@Neil: google is not too far off now
D.Shawley
Not only is it verbatim from wikipedia, but it isn't helpful. Even better! If you use std::tr1 now, it will work for a very long time. The value of "very" will vary based on your compiler, but long enough for you go to back through your source and change boost:: or tr1:: to std::
Nick Bastin
@Neil: Is there a more preferred method when a verbatim quote from the web presumes to answer the question?
Shmoopty
@Shmoopty Yes, provide a one sentence summary, like "Wikipedia, that well known font of C++ knowledge, says" and then the link. That way, if wikiipedia gets updated, so does SO. That's why this thing is called a "web".
anon
There is a link. The bold section adds to the previous commentary on this page, and I posted this because it was news to me, and I thought it might be either wrong, or news to someone else as well. And as C++0x is not finalized (as I understand it) it might not even happen. I originally thought about just posting a link and suggesting the questioner do appropriate internet searches in standards and related documents, but, you know, it just seemed too patronizing. As for the vote - I would be happy to donate it to anyone who wants it.
Permaquid
+8  A: 

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)

Terry Mahaffey