Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Daniel Krügler<daniel.kruegler@googlemail.com> |
|---|---|
| Newsgroups | comp.std.c++ |
| Subject | Re: Defect Report [class.this]/2 |
| Date | 2011-04-27 10:55 -0600 |
| Organization | A noiseless patient Spider |
| Message-ID | <ip8vb3$9e2$1@dont-email.me> (permalink) |
| References | <9cfb4890-efd0-422b-b412-f1ad9b39a0bf@x37g2000prb.googlegroups.com> |
On 2011-04-25 20:14, James Kanze wrote: > > This is probably editorial, but it should be fixed. > [class.this]/9 states: > > In a const member function, the object for which the > function is called is accessed through a const access > path; therefore, a const member function shall not > modify the object and its non-static data members. > > This is clearly wrong: a const member function may modify the > object through another, non-const pointer, it may modify mutable > members, and it may cast away const, and modify anything in the > object. > > The effects of const on the type of this are clearly stated in > the preceding paragraph; I would just drop this paragraph > (perhaps keeping the example, attaching it to the previous > paragraph, and adding more comment to the error case, along the > lines of "since 'a++' is 'this->a++', and 'this' has type 'const > s'"). Forwarded to core working group. Greetings from Bremen, Daniel Krügler -- [ comp.std.c++ is moderated. To submit articles, try posting with your ] [ newsreader. If that fails, use mailto:std-cpp-submit@vandevoorde.com ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Back to comp.std.c++ | Previous | Next — Previous in thread | Find similar
Defect Report [class.this]/2 James Kanze<james.kanze@gmail.com> - 2011-04-25 12:14 -0600 Re: Defect Report [class.this]/2 Daniel Krügler<daniel.kruegler@googlemail.com> - 2011-04-27 10:55 -0600
csiph-web