Article View: comp.sys.mac.programmer.codewarrior
Article #1116Re: unnamed namespaces in CW5.3
From: Adin Hunter Baber
Date: Wed, 24 Oct 2001 23:32
Date: Wed, 24 Oct 2001 23:32
37 lines
2752 bytes
2752 bytes
In article <macdev-854F03.01445224102001@senator-bedfellow.mit.edu>, meeroh <macdev@meeroh.org> wrote: > In article > <mjolnir_DELETE_-8A9595.23380323102001@east.usenetserver.com>, > Adin Hunter Baber <mjolnir_DELETE_@soltec.net> wrote: > > >I was trying to put some classes in an unnamed namespace. The classes > >provide some extra functionality in that header, and don't need to be > >used outside of it. however, I am finding that I am able to create > >instances of these classes inside my main function. > > > >Is this an error in CW5.3? Is it fixed in CW7? > > I think you misunderstand what the unnamed namespace is for. This is not > an error, as far as I know. The members of the unnamed namespace are > available throughout the compilation unit -- i.e. they will be available > in any cpp file which includes the header. > > Perhaps if you show us how you are using class Stuff in the header file > we can suggest alternatives You are correct, I did misunderstand the use of unnamed namespaces. I did not realize that they are supposed to be exposed in such a way. I guess I could just use a namespace BehindTheScenesStuffYouNoUse :) Please note my spam blocked address, it is included in the e-mail since I responded from my news reader. -- Adin Hunter Baber "Death is lighter than a feather, Duty heavier than a mountain" "...nevertheless, they fought on even though their homes were piles of ashes, even though they knew they could not win they still fought on,..."
Technical Details
Message-ID:
<mjolnir_DELETE_-3E19C3.18315324102001@east.usenetserver.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!cyclone.bc.net!sjcppf01.usenetserver.com!e420r-sjo4.usenetserver.com!usenetserver.com!atlpnn01.usenetserver.com.POSTED!mjolnir_DELETE_References:
<mjolnir_DELETE_-8A9595.23380323102001@east.usenetserver.com> <macdev-854F03.01445224102001@senator-bedfellow.mit.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10bcce,426dc3c68e8241c3 X-Google-Attributes: gid10bcce,public X-Google-Thread: f635e,426dc3c68e8241c3 X-Google-Attributes: gidf635e,public X-Google-ArrivalTime: 2001-10-24 16:35:56 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!cyclone.bc.net!sjcppf01.usenetserver.com!e420r-sjo4.usenetserver.com!usenetserver.com!atlpnn01.usenetserver.com.POSTED!mjolnir_DELETE_ From: Adin Hunter Baber <mjolnir_DELETE_@soltec.net> Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.mac Subject: Re: unnamed namespaces in CW5.3 Organization: Soltec References: <mjolnir_DELETE_-8A9595.23380323102001@east.usenetserver.com> <macdev-854F03.01445224102001@senator-bedfellow.mit.edu> Posted-And-Mailed: yes User-Agent: MT-NewsWatcher/3.1 (PPC) Message-ID: <mjolnir_DELETE_-3E19C3.18315324102001@east.usenetserver.com> Lines: 37 X-Complaints-To: abuse@usenetserver.com X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly. NNTP-Posting-Date: Wed, 24 Oct 2001 19:30:31 EDT Date: Wed, 24 Oct 2001 18:32:09 -0500