Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #7300
| From | Victor Bazarov <v.bazarov@comcast.invalid> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: Private static class members |
| Date | 2011-06-30 13:26 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <iuibja$vtg$2@dont-email.me> (permalink) |
| References | <ygfd3hv7hgq.fsf@janus.isnogud.escape.de> <4e0c55db$0$2818$7b1e8fa0@news.nbl.fi> <iuhpf0$vu6$1@dont-email.me> <4e0c6f11$0$2832$7b1e8fa0@news.nbl.fi> |
On 6/30/2011 8:41 AM, Juha Nieminen wrote: > Victor Bazarov<v.bazarov@comcast.invalid> wrote: >> On 6/30/2011 6:54 AM, Juha Nieminen wrote: >>> Urs Thuermann<urs@isnogud.escape.de> wrote: >>>> static std::list<Foo *> all_foos; >>> >>> The more recommended idiom is to use a nameless namespace instead of the >>> 'static' keyword, but that works as well. >> >> Did you miss the fact that 'all_foos' is a data member of a class? > > Did you miss the fact that the original poster wanted to remove the > static data member from the class and put it in the compilation unit > instead? Right. There were two lines with that code, and I was sure you were quoting the first one. My mistake. As for the unnamed namespace, I don't agree. All names in it have external linkage, and I for one don't see the reason to have more exported symbols when they can't be accessed from outside anyway. I vote for static. V -- I do not respond to top-posted replies, please don't ask
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Private static class members Urs Thuermann <urs@isnogud.escape.de> - 2011-06-30 12:15 +0200
Re: Private static class members Juha Nieminen <nospam@thanks.invalid> - 2011-06-30 10:54 +0000
Re: Private static class members Victor Bazarov <v.bazarov@comcast.invalid> - 2011-06-30 08:16 -0400
Re: Private static class members Juha Nieminen <nospam@thanks.invalid> - 2011-06-30 12:41 +0000
Re: Private static class members Victor Bazarov <v.bazarov@comcast.invalid> - 2011-06-30 13:26 -0400
Re: Private static class members Paul Brettschneider <paul.brettschneider@yahoo.fr> - 2011-07-01 00:32 +0200
Re: Private static class members red floyd <redfloyd@gmail.com> - 2011-07-01 15:18 -0700
Re: Private static class members Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-06-30 15:17 +0000
Re: Private static class members Ian Collins <ian-news@hotmail.com> - 2011-07-01 10:46 +1200
csiph-web