Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #6171

Re: Anonymous namespace

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news.nobody.at!texta.sil.at!news-zh.switch.ch!kanaga.switch.ch!switch.ch!newsfeed-00.mathworks.com!panix!not-for-mail
From Ruben Safir <ruben@mrbrklyn.com>
Newsgroups comp.lang.c++
Subject Re: Anonymous namespace
Date Sat, 4 Jun 2011 05:05:59 +0000 (UTC)
Organization PANIX Public Access Internet and UNIX, NYC
Lines 28
Message-ID <iscefn$keo$3@reader1.panix.com> (permalink)
References <is9eqf$ft8$2@reader1.panix.com> <unnamed-namespace-20110603040622@ram.dialup.fu-berlin.de> <is9hj6$91p$1@reader1.panix.com> <unnamed-namespaces-20110603045329@ram.dialup.fu-berlin.de> <is9v15$gpd$1@reader1.panix.com> <94rjavFbjiU7@mid.individual.net>
NNTP-Posting-Host www2.mrbrklyn.com
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Trace reader1.panix.com 1307163959 20952 96.57.23.82 (4 Jun 2011 05:05:59 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Sat, 4 Jun 2011 05:05:59 +0000 (UTC)
X-Blackjet Blackjet is a Yankee Fan
X-DRMisTHEFT Use GNU Linux today
X-From A Dark Cloud
X-LOCATION Brooklyn NY - Forget abou' it!
X-NYLXS Really - yah think computers are supposed to be broken?
User-Agent Pan/0.133 (House of Butterflies)
Xref x330-a1.tempe.blueboxinc.net comp.lang.c++:6171

Show key headers only | View raw


On Fri, 03 Jun 2011 20:12:15 +1200, Ian Collins wrote:

>  
>>
>> 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.

Ok - I'm getting a clearer picture.  What specifically did you mean, 
however, by the phrase "even if they should have external linkage"

This is why I wanted a job with a lot of smart C++ coders.  I'd sweep the 
floor if need be.

Ruben.

Back to comp.lang.c++ | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Anonymous namespace ruben safir <ruben@mrbrklyn.com> - 2011-06-02 21:53 -0400
  Re: Anonymous namespace Pete Becker <pete@versatilecoding.com> - 2011-06-02 16:00 -1000
  Re: Anonymous namespace ruben safir <ruben@mrbrklyn.com> - 2011-06-02 22:40 -0400
    Re: Anonymous namespace ruben safir <ruben@mrbrklyn.com> - 2011-06-03 02:29 -0400
      Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-03 20:12 +1200
        Re: Anonymous namespace Ruben Safir <mrbrklyn@panix.com> - 2011-06-04 02:40 +0000
          Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-04 15:40 +1200
            Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 04:56 +0000
              Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-04 17:19 +1200
                Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 05:37 +0000
                Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-04 17:40 +1200
        Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 05:05 +0000
          Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-04 17:31 +1200
            Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 05:42 +0000
      Re: Anonymous namespace Öö Tiib <ootiib@hot.ee> - 2011-06-03 06:08 -0700
        Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 05:09 +0000
          Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-04 17:32 +1200
            Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 05:39 +0000
              Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-04 17:45 +1200
    Re: Anonymous namespace gwowen <gwowen@gmail.com> - 2011-06-03 01:08 -0700
      Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-03 20:17 +1200
        Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 05:08 +0000
      Re: Anonymous namespace Victor Bazarov <v.bazarov@comcast.invalid> - 2011-06-03 09:44 -0400
        Re: Anonymous namespace Ruben Safir <mrbrklyn@panix.com> - 2011-06-04 02:44 +0000
        Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-04 15:57 +1200
        Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 05:14 +0000
          Re: Anonymous namespace "Bo Persson" <bop@gmb.dk> - 2011-06-04 11:33 +0200
  Re: Anonymous namespace Michael Doubez <michael.doubez@free.fr> - 2011-06-03 03:10 -0700
    Re: Anonymous namespace Ruben Safir <mrbrklyn@panix.com> - 2011-06-04 02:48 +0000
      Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-04 16:01 +1200
        Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 05:16 +0000
          Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-04 17:34 +1200
  Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 05:01 +0000
    Re: Anonymous namespace Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-06-09 11:26 +0000
      Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-10 04:12 +0000
        Re: Anonymous namespace Michael Doubez <michael.doubez@free.fr> - 2011-06-10 01:49 -0700
          Re: Anonymous namespace mrbrklyn <ceo.brooklyn@gmail.com> - 2011-06-10 10:34 -0700
          Re: Anonymous namespace mrbrklyn <ceo.brooklyn@gmail.com> - 2011-06-10 10:45 -0700
            Re: Anonymous namespace Michael Doubez <michael.doubez@free.fr> - 2011-06-12 00:01 -0700
              Re: Anonymous namespace ruben safir <ruben@mrbrklyn.com> - 2011-06-13 04:08 +0000
        Re: Anonymous namespace Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-06-10 18:27 +0000

csiph-web