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


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

Re: Anonymous namespace

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!news.glorb.com!postnews.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date Thu, 02 Jun 2011 21:00:21 -0500
From Pete Becker <pete@versatilecoding.com>
Organization Roundhouse Consulting, Ltd.
Newsgroups comp.lang.c++
Date Thu, 2 Jun 2011 16:00:21 -1000
Message-ID <2011060216002187959-pete@versatilecodingcom> (permalink)
References <is9eqf$ft8$2@reader1.panix.com>
MIME-Version 1.0
Content-Type text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding 8bit
Subject Re: Anonymous namespace
User-Agent Unison/2.1.4
Lines 23
X-Usenet-Provider http://www.giganews.com
X-Trace sv3-1Dg0paL6DA6sLQ+EJIh4PpzbDejNFBMH1/KpxETtOaWyhdbYV9lLpNFqsVdyurAH8FJPvN5Puj1HviC!B1mIkapXGG7U70V0oMqsJ1h6w99ZADnfR7Sn/WiC8XDMsIr8Qk3/w2YTr/u+Qs6JChRfARY=
X-Complaints-To abuse@giganews.com
X-DMCA-Notifications http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 1602
Xref x330-a1.tempe.blueboxinc.net comp.lang.c++:6113

Show key headers only | View raw


On 2011-06-02 15:53:19 -1000, ruben safir said:

> what is the anonymous name space and how is it accessed?

namespace {
int i;
}

int main() {
	i = 3;
	return 0;
}

Each translation unit has a separate anonymous namespace. Name lookup 
looks at names in the anonymous namespace, so there's nothing special 
you should do (or can do) to access it.

-- 
  Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The 
Standard C++ Library Extensions: a Tutorial and Reference 
(www.petebecker.com/tr1book)

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


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 Michael Doubez <michael.doubez@free.fr> - 2011-06-13 08:43 -0700
        Re: Anonymous namespace Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-06-10 18:27 +0000
          Re: Anonymous namespace ruben safir <ruben@mrbrklyn.com> - 2011-06-13 05:02 +0000
            Re: Anonymous namespace Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-06-13 07:58 +0000
              Re: "namespaces were a mistake" (was: Anonymous namespace) Öö Tiib <ootiib@hot.ee> - 2011-06-13 09:56 -0700
              Re: "namespaces were a mistake" (was: Anonymous namespace) Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-06-13 19:52 +0000
                Re: "namespaces were a mistake" Miles Bader <miles@gnu.org> - 2011-06-14 13:43 +0900
                Re: "namespaces were a mistake" Miles Bader <miles@gnu.org> - 2011-06-15 07:15 +0900
                Re: "namespaces were a mistake" Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-06-15 12:01 +0000
                Re: "namespaces were a mistake" (was: Anonymous namespace) drew@furrfu.invalid (Drew Lawson) - 2011-06-14 12:24 +0000
                Re: "namespaces were a mistake" (was: Anonymous namespace) gwowen <gwowen@gmail.com> - 2011-06-14 06:00 -0700
                Re: "namespaces were a mistake" (was: Anonymous namespace) Joshua Maurice <joshuamaurice@gmail.com> - 2011-06-14 14:10 -0700
                Re: "namespaces were a mistake" Miles Bader <miles@gnu.org> - 2011-06-15 06:30 +0900
              Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-27 16:34 +0000
                Re: Anonymous namespace Victor Bazarov <v.bazarov@comcast.invalid> - 2011-06-27 14:29 -0400

csiph-web