Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucsd!orion.cf.uci.edu!uci-ics!news From: schmidt@zola.ics.uci.edu (Doug Schmidt) Newsgroups: gnu.g++.bug Subject: Re: bug with const class objects. Keywords: g++ const Message-ID: <1989Sep2.001332.25292@paris.ics.uci.edu> Date: 2 Sep 89 00:13:32 GMT References: <8758@batcomputer.tn.cornell.edu> Sender: news@paris.ics.uci.edu (Network News) Reply-To: schmidt@zola.ics.uci.edu (Doug Schmidt) Organization: University of California, Irvine - Dept of ICS Lines: 33 In-reply-to: lijewski@batcomputer.tn.cornell.edu (Mike Lijewski) In article <8758@batcomputer.tn.cornell.edu>, lijewski@batcomputer (Mike Lijewski) writes: > >The following script illustrates a program with sets a member >of a class object which is declared const using a non-const member >function. It is my understanding that this should be flagged >during compilation as an error. > > >Script started on Fri Sep 1 15:30:37 1989 > >robbie(1)->cat b.cc > >class foo{ > int x; > public: > void set(int i) { x = i; } >}; > >main(void) >{ > const foo i; > > i.set(24); >} This is fixed in a later beta release... Doug -- schmidt@ics.uci.edu (ARPA) | Per me si va nella citta' dolente. office: (714) 856-4043 | Per me si va nell'eterno dolore. | Per me si va tra la perduta gente. | Lasciate ogni speranza o voi ch'entrate.