MESSAGE
DATE | 2011-06-05 |
FROM | Ruben Safir
|
SUBJECT | Subject: [NYLXS - HANGOUT] (fwd) Re: Anonymous namespace
|
-- forwarded message -- Path: reader1.panix.com!panix!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.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 Organization: Roundhouse Consulting, Ltd. Newsgroups: comp.lang.c++ Date: Thu, 2 Jun 2011 16:00:21 -1000 Message-ID: <2011060216002187959-pete-at-versatilecodingcom> References: 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-at-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: panix comp.lang.c++:1085947
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)
-- end of forwarded message --
|
|