From 6658217074554886543
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,47ad86575b18887f
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-07-18 09:00:01 PST
Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!194.42.224.136!diablo.netcom.net.uk!netcom.net.uk!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: iltchenko@yahoo.com (Andrei Iltchenko)
Newsgroups: comp.std.c++
Subject: Re: unnamed namespace quesion
Date: Wed, 18 Jul 2001 15:58:42 GMT
Organization: http://groups.google.com/
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <b5545f76.0107180755.5cf8ec63@posting.google.com>
References: <JhK47.359227$p33.7267027@news1.sttls1.wa.home.com> <3B54E127.E35402FF@wizard.net>
X-Trace: mail2news.demon.co.uk 995471941 mail2news:27308 mail2news mail2news.demon.co.uk
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Date: 18 Jul 2001 15:55:46 GMT
Lines: 45
Xref: archiver1.google.com comp.std.c++:6593

"James Kuyper Jr." <kuyper@wizard.net> wrote in message news:<3B54E127.E35402FF@wizard.net>...

> Paul Mensonides wrote:
> > 
> > Is it legal to define a function outside of an unnamed namespace?
> > 
> > namespace {
> >     void f();
> > }
> > 
> > void f() {
> >     return;
> > }
> 
> Yes. What you've done there is define f() in the global namespace.
> 
> > If it isn't, it should be.  Defining functions in a nested fashion is annoying,
> > and it makes me (and possibly others) prefer 'static' functions:
> > 
> > static void f() {
> >     return;
> > }
> 
> That use of static is officially deprecated, in favor of the following:
> > namespace {
> >     void f() {
> >         return;
> >     }
> > }

The Standard only depricates namespace scope _object declarations_
that feature the keyword static. No mentioning of _function
declarations_ is made. See 7.3.1.1/2 and D.2/1.


Regards,

Andrei Iltchenko.

---
[ 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.research.att.com/~austern/csc/faq.html                ]



