Topic: Library name constraints too restrictive?
Author: "=?ISO-8859-1?Q?Daniel_Kr=FCgler?=" <daniel.kruegler@googlemail.com>
Date: Thu, 6 Dec 2007 20:03:44 CST Raw View
In [intro.compliance]/5 we find (both in TR1 and in the recent
draft N2461):
"The names defined in the library have namespace scope (7.3).
A C++ translation unit (2.1) obtains access to these names by
including the appropriate standard library header (16.2)."
First: What is the explicit specification of "namespace scope"
supposed to mean? Are there other thinkable library names
than those from either namespace scope or class scope? This
brings me to the next question: Does the above narrowing
requirement mean that e.g.
std::string::npos
std::ios_base::failure
std::ios_base::iostate
..
are not part of library? According to my understanding of
[basic.scope.class]/1+2 all of these are class scope names
und until now I considered them as part of the library.
Thanks for the clarification,
Daniel Kr gler
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: "=?ISO-8859-1?Q?Daniel_Kr=FCgler?=" <daniel.kruegler@googlemail.com>
Date: Fri, 7 Dec 2007 12:58:24 CST Raw View
On 7 Dez., 03:03, "Daniel Kr gler" <daniel.krueg...@googlemail.com>
wrote:
For anyone wondering: This posting has not been repeatedly
sent by be. I assume that this is an artifact of e.g. some
internet weatherstorm or maybe a moderator who just came
back from holidays (or Santa Claus?).
Greetings from Bremen,
Daniel Kr gler
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: "=?ISO-8859-1?Q?Daniel_Kr=FCgler?=" <daniel.kruegler@googlemail.com>
Date: Wed, 28 Nov 2007 09:31:11 CST Raw View
In [intro.compliance]/5 we find (both in TR1 and in the recent
draft N2461):
"The names defined in the library have namespace scope (7.3).
A C++ translation unit (2.1) obtains access to these names by
including the appropriate standard library header (16.2)."
First: What is the explicit specification of "namespace scope"
supposed to mean? Are there other thinkable library names
than those from either namespace scope or class scope? This
brings me to the next question: Does the above narrowing
requirement mean that e.g.
std::string::npos
std::ios_base::failure
std::ios_base::iostate
.
are not part of library? According to my understanding of
[basic.scope.class]/1+2 all of these are class scope names
and until now I considered them as part of the library.
Thanks for the clarification,
Daniel Kr gler
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: Greg Herlihy <greghe@mac.com>
Date: Sun, 2 Dec 2007 20:52:06 CST Raw View
On Nov 28, 7:31 am, "Daniel Kr gler" <daniel.krueg...@googlemail.com>
wrote:
> In [intro.compliance]/5 we find (both in TR1 and in the recent
> draft N2461):
>
> "The names defined in the library have namespace scope (7.3).
> A C++ translation unit (2.1) obtains access to these names by
> including the appropriate standard library header (16.2)."
>
> First: What is the explicit specification of "namespace scope"
> supposed to mean? Are there other thinkable library names
> than those from either namespace scope or class scope?
According the paragraph quoted, it would not matter if there were
other ways of naming entities in C++ - since the Standard Library
would not use them. In short, this quoted paragraph is simply stating
that the Standard Library is not "special" - but instead uses the same
naming mechanisms as the user's own programs.
> This
> brings me to the next question: Does the above narrowing
> requirement mean that e.g.
>
> std::string::npos
> std::ios_base::failure
> std::ios_base::iostate
>
> are not part of library? According to my understanding of
> [basic.scope.class]/1+2 all of these are class scope names
> and until now I considered them as part of the library.
No, the names listed above have (global) namespace scope. The
corresponding names with class scope are:
npos
failure
iostate
But since these names do not have namespace scope, a user program
would not be able to use them. Instead a user program has to use:
"string::npos", "ios_base::failure" and "ios_base::iostate" within the
"std" namespace in order to access these Standard Library entities.
Greg
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]