Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #7283
| From | Victor Bazarov <v.bazarov@comcast.invalid> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: Private static class members |
| Date | 2011-06-30 08:16 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <iuhpf0$vu6$1@dont-email.me> (permalink) |
| References | <ygfd3hv7hgq.fsf@janus.isnogud.escape.de> <4e0c55db$0$2818$7b1e8fa0@news.nbl.fi> |
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? > >> OTOH, this means that `all_foos' is no longer part of the class and >> may be accessilbe by other non-member and non-friend functions in >> foo.cc. > > That file should contain the implementation of the class, so it shouldn't > be a problem. Any ancillary functions inside that file are part of the > implementation of the class (even if they are not declared as members of > the class). You shouldn't implement any non-related functions there. > > I see no problem. 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