MESSAGE
DATE | 2011-06-05 |
FROM | Ruben Safir
|
SUBJECT | Subject: [NYLXS - HANGOUT] (fwd) Re: Anonymous namespace
|
From owner-hangout-outgoing-at-mrbrklyn.com Sun Jun 5 00:27:27 2011 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: by www2.mrbrklyn.com (Postfix) id B6D96100BA7; Sun, 5 Jun 2011 00:27:26 -0400 (EDT) Delivered-To: hangout-outgoing-at-www2.mrbrklyn.com Received: by www2.mrbrklyn.com (Postfix, from userid 28) id 25A1C100BA5; Sun, 5 Jun 2011 00:27:25 -0400 (EDT) Delivered-To: hangout-at-nylxs.com Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by www2.mrbrklyn.com (Postfix) with ESMTP id E9034100B85 for ; Sun, 5 Jun 2011 00:27:22 -0400 (EDT) Received: from panix2.panix.com (panix2.panix.com [166.84.1.2]) by mailbackend.panix.com (Postfix) with ESMTP id 2835232EFD for ; Sun, 5 Jun 2011 00:27:36 -0400 (EDT) Received: by panix2.panix.com (Postfix, from userid 20529) id 1699933C1F; Sun, 5 Jun 2011 00:27:36 -0400 (EDT) From: Ruben Safir To: hangout-at-nylxs.com Subject: [NYLXS - HANGOUT] (fwd) Re: Anonymous namespace User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (NetBSD/5.1 (i386)) Message-Id: <20110605042736.1699933C1F-at-panix2.panix.com> Date: Sun, 5 Jun 2011 00:27:36 -0400 (EDT) Sender: owner-hangout-at-mrbrklyn.com Precedence: bulk Reply-To: hangout-at-mrbrklyn.com
-- forwarded message -- Path: reader1.panix.com!panix!panix.com!mrbrklyn From: Ruben Safir Newsgroups: comp.lang.c++ Subject: Re: Anonymous namespace Date: Sat, 4 Jun 2011 02:40:16 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 28 Message-ID: References: <94rjavFbjiU7-at-mid.individual.net> NNTP-Posting-Host: panix2.panix.com X-Trace: reader1.panix.com 1307155216 11543 166.84.1.2 (4 Jun 2011 02:40:16 GMT) X-Complaints-To: abuse-at-panix.com NNTP-Posting-Date: Sat, 4 Jun 2011 02:40:16 +0000 (UTC) User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (NetBSD/5.1 (i386)) Xref: panix comp.lang.c++:1085996
Ian Collins wrote: > On 06/ 3/11 06:29 PM, ruben safir wrote: >> On 06/02/2011 10:54 PM, Stefan Ram wrote: >>>>> What is the point of the anonymous namespace. >>> Names can be hidden from the linker (from other translation >>> units), even if they should have external linkage. >> >> please expand? > > One way to look at the anonymous namespace is to consider it a namespace > with a cryptic name. That name is only known within the current > compilation unit. Thus anything declared within the namespace can't > been seen elsewhere because the namespace name is unknown. > > So I could write > > namespace { int n; } > > and n would only be visible within the current compilation unit whereas > > int n; > > would be globally visible. >
so the annonymous name space must be in the same file as main?
Ruben -- end of forwarded message --
|
|