HOWTO: const and pointer variants in C and C++ : c++
This is a discussion on HOWTO: const and pointer variants in C and C++ within the c++ forums in Programming Languages category; James Kuyper wrote: > pete wrote: >> Hendrik Schober wrote: >>> pete wrote: >>>> [...] >>>> I don't think that removing const >>>> ever changes the semantics of a program. >>> >>> struct test { >>> int f() {return 1;} >>> int f() const {return 0;} >>> }; >>> >>> int main() >>> { >>> /*const*/ test x; >>> return x.f(); >>> } >> >> In order to make a point, >> you would have to post a correct c program > > In case you haven't noticed, this message is cross-posted to two groups > where C++ code is ...
| c++ comp.lang.c++ usenet archive |
![]() |
| | LinkBack | Thread Tools |
|
#31
| |||
| |||
| > pete wrote: >> Hendrik Schober wrote: >>> pete wrote: >>>> [...] >>>> I don't think that removing const >>>> ever changes the semantics of a program. >>> >>> struct test { >>> int f() {return 1;} >>> int f() const {return 0;} >>> }; >>> >>> int main() >>> { >>> /*const*/ test x; >>> return x.f(); >>> } >> >> In order to make a point, >> you would have to post a correct c program > > In case you haven't noticed, this message is cross-posted to two groups > where C++ code is entirely appropriate; I hadn't noticed. > the Subject: line might also be a hint. -- pete |
|
#32
| |||
| |||
| Flash Gordon wrote: > Pete Becker wrote, On 11/11/08 20:24: >> On 2008-11-11 15:16:00 -0500, Flash Gordon <smap@spam.causeway.com> said: >> >>> James Kuyper wrote, On 11/11/08 19:12: >>>> pete wrote: >>> <snip> >>> >>>>> In order to make a point, >>>>> you would have to post a correct c program >>>> In case you haven't noticed, this message is cross-posted to two groups >>>> where C++ code is entirely appropriate; the Subject: line might also be >>>> a hint. >>> It is also posted to a group where C++ is NOT topical. The way pete >>> indicated this might not be the best, but it is certainly true that the >>> example given was not correct for comp.lang.c where only C is topical. >>> Is it really too difficult for people with C++ specific answers to drop >>> the cross-post to comp.lang.c? >> It's no more difficult than for people with comments about the >> appropriateness of postings in comp.lang.c to drop the cross-post to >> comp.lang.c++. > > I had not registered that it was James Kuyper, who does read > comp.lang.c, who made the comment above about it being topical in two of > the groups this is cross-posted to. Sorry. If I had registered I would > have dropped the cross-post. I think that a comparison between C and C++ with regard to 'const' and pointers should be on-topic in all three groups, but that everyone involved in such a discussion should be careful to distinguish which language they're talking about at any given point in the discussion, except when making a statement that they believe to be true in both languages. |
|
#33
| |||
| |||
| Flash Gordon wrote: > Pete Becker wrote, On 11/11/08 20:24: >> On 2008-11-11 15:16:00 -0500, Flash Gordon <smap@spam.causeway.com> said: >> >>> James Kuyper wrote, On 11/11/08 19:12: >>>> pete wrote: >>> <snip> >>> >>>>> In order to make a point, >>>>> you would have to post a correct c program >>>> In case you haven't noticed, this message is cross-posted to two groups >>>> where C++ code is entirely appropriate; the Subject: line might also be >>>> a hint. >>> It is also posted to a group where C++ is NOT topical. The way pete >>> indicated this might not be the best, but it is certainly true that the >>> example given was not correct for comp.lang.c where only C is topical. >>> Is it really too difficult for people with C++ specific answers to drop >>> the cross-post to comp.lang.c? >> It's no more difficult than for people with comments about the >> appropriateness of postings in comp.lang.c to drop the cross-post to >> comp.lang.c++. > > I had not registered that it was James Kuyper, who does read > comp.lang.c, who made the comment above about it being topical in two of > the groups this is cross-posted to. Sorry. If I had registered I would > have dropped the cross-post. I think that a comparison between C and C++ with regard to 'const' and pointers should be on-topic in all three groups, but that everyone involved in such a discussion should be careful to distinguish which language they're talking about at any given point in the discussion, except when making a statement that they believe to be true in both languages. |

