 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Wu Yongwei Guest
|
Posted: Mon Jul 11, 2005 10:17 am Post subject: Why the `tr1' namespace |
|
|
I really feel confused. Why not using `std' directly? And I guess
when C++-0x officially comes out, namespaces like `tr1' will be gone
(or not?). What changes need to be applied to current programs that
use `tr1::'?
Anyone knowing the rationale can enlighten me?
Best regards,
Yongwei
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
ulrich Guest
|
Posted: Mon Jul 11, 2005 3:09 pm Post subject: Re: Why the `tr1' namespace |
|
|
On 11 Jul 2005 06:17:28 -0400, Wu Yongwei <wuyongwei (AT) gmail (DOT) com> wrote:
| Quote: | I really feel confused. Why not using `std' directly? And I guess
when C++-0x officially comes out, namespaces like `tr1' will be gone
(or not?). What changes need to be applied to current programs that
use `tr1::'?
Anyone knowing the rationale can enlighten me?
|
well, imho, the rationale is just that anything in tr1 is NOT YET part of
the standard...
| Quote: | Best regards,
Yongwei
|
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Warren Young Guest
|
Posted: Mon Jul 11, 2005 3:11 pm Post subject: Re: Why the `tr1' namespace |
|
|
Wu Yongwei wrote:
| Quote: | I really feel confused. Why not using `std' directly?
|
Because TR1 is not normative. That means that a vendor can ship a C++
compiler without TR1 and still be compliant. I suppose that these
extensions will become normative in a later edition of the C++ standard,
at which time they'll move into the main std namespace.
By putting these symbols into a separate, temporary namespace, they
reserve the right to change things before moving them to namespace std.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Francis Glassborow Guest
|
Posted: Mon Jul 11, 2005 3:11 pm Post subject: Re: Why the `tr1' namespace |
|
|
In article <1121070151.085959.255270 (AT) g49g2000cwa (DOT) googlegroups.com>, Wu
Yongwei <wuyongwei (AT) gmail (DOT) com> writes
| Quote: | I really feel confused. Why not using `std' directly? And I guess
when C++-0x officially comes out, namespaces like `tr1' will be gone
(or not?). What changes need to be applied to current programs that
use `tr1::'?
Anyone knowing the rationale can enlighten me?
|
Very simply, they are not part of the standard library and we have no
intention of committing future generations to treat them as such. Of
course many of the TR1 entities will become part of a future Standard
Library but not all of them and not all in exactly the form they are in
TR1
--
Francis Glassborow ACCU
Author of 'You Can Do It!' see http://www.spellen.org/youcandoit
For project ideas and contributions: http://www.spellen.org/youcandoit/projects
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Howard Hinnant Guest
|
Posted: Mon Jul 11, 2005 3:13 pm Post subject: Re: Why the `tr1' namespace |
|
|
In article <1121070151.085959.255270 (AT) g49g2000cwa (DOT) googlegroups.com>,
"Wu Yongwei" <wuyongwei (AT) gmail (DOT) com> wrote:
| Quote: | I really feel confused. Why not using `std' directly? And I guess
when C++-0x officially comes out, namespaces like `tr1' will be gone
(or not?). What changes need to be applied to current programs that
use `tr1::'?
Anyone knowing the rationale can enlighten me?
|
The std::tr1 namespace represents components described in the first
library technical report.
This technical report is non-normative. Some of the library components
in this technical report may be considered for standardization in a
future version of C++, but they are not currently part of any C++
standard. Some of the componein this technical report may never be
standardized, and others may be standardized in a substantially changed
form.
The goal of this technical report it to build more widespread existing
practice for an expanded C++ standard library. It gives advice on
extensions to those vendors who wish to provide them.
If a std::tr1 component (X) is modified during standardization, it will
be easier for developers to distinguish the standardized version
(std::X) from the tr1 version (std::tr1::X). Thus a forward migration
path is built in to this process.
-Howard
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
msalters Guest
|
Posted: Mon Jul 11, 2005 3:14 pm Post subject: Re: Why the `tr1' namespace |
|
|
Wu Yongwei schreef:
| Quote: | I really feel confused. Why not using `std' directly?
|
Because the TR1 library is not part of the Standard (C++03).
Anything in TR1 might be altered before moving into std:: itself.
| Quote: | And I guess when C++-0x officially comes out, namespaces like
`tr1' will be gone (or not?). What changes need to be applied
to current programs that use `tr1::'?
|
That's not certain yet. C++0x is still a work in progress. But
the C90 stuff is still available in ::, so I expect tr1:: to
remain - at least in compilers, possibly in the standard as
a deprecated namespace.
Regards,
Michiel Salters
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|