From -8038557998140456447
X-Google-Thread: f78e5,ec5593fcdace0691
X-Google-Attributes: gidf78e5,public,usenet
X-Google-Language: ENGLISH,ASCII
Path: g2news1.google.com!news2.google.com!news.glorb.com!news.alt.net!comp-std-cpp-robomod!not-for-mail
From: Greg Herlihy <greghe@mac.com>
Newsgroups: comp.std.c++
Subject: Re: Library name constraints too restrictive?
Date: Sun,  2 Dec 2007 20:52:06 CST
Organization: http://groups.google.com
Lines: 53
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <e29af888-32f4-4067-bcb9-8078e90d32f5@i12g2000prf.googlegroups.com>
References: <f7cbe61e-056e-46f7-89de-b6c98402c3af@x69g2000hsx.googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1196561880 20226 127.0.0.1 (2 Dec 2007 02:18:00 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sun, 2 Dec 2007 02:18:00 +0000 (UTC)
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.csse.unimelb.edu.au: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Original-To: std-c++@mailman.ucar.edu
Delivered-To: std-c++@mailman.ucar.edu
X-SMTP-Auth: no
Complaints-To: groups-abuse@google.com
Injection-Info: i12g2000prf.googlegroups.com; posting-host=69.181.119.118; 
	posting-account=gEjj5woAAABgjktZcDmEHki66uW5XDo0
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-us) 
	AppleWebKit/523.10.3 (KHTML, like Gecko) Version/3.0.4 Safari/523.10,gzip(gfe),gzip(gfe)
Content-Disposition: inline
X-Virus-Scanned: amavisd-new at ucar.edu
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
X-MIME-Autoconverted: from quoted-printable to 8bit by mulga.csse.unimelb.edu.au id lB2NvMMB007936
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
Xref: g2news1.google.com comp.std.c++:9724

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                      ]



