Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!news.mathworks.com!news.kei.com!nntp.coast.net!torn!nott!cunews!dbuck
From: dbuck@superior.carleton.ca (Dave Buck)
Subject: Re: The Future of Smalltalk Performance?
X-Nntp-Posting-Host: superior.carleton.ca
Message-ID: <DLKFsC.7zo@cunews.carleton.ca>
Sender: news@cunews.carleton.ca (News Administrator)
Organization: Carleton University, Ottawa, Canada
References: <4crvvl$jd5@news.jf.intel.com> <4dougr$rgv@citadel.evolving.com> <DLHMF9.Cvn@cunews.carleton.ca> <4dugpg$t0g@rex.sfe.com.au>
Date: Mon, 22 Jan 1996 04:43:24 GMT
Lines: 48

In article <4dugpg$t0g@rex.sfe.com.au>, Paul Hatchman <paul@sfe.com.au> wrote:
>dbuck@superior.carleton.ca (Dave Buck) writes:
>
>>I think you have it backwards.  Consider:
>
>>class A {
>>    public:
>>       const int x();
>>    };
>
>>class B {
>>    public:
>>       A a;
>>       const int y() {return a.x() + 5};
>>    };
>
>>Changing A's member function x() to remove the const means that B's
>>member function y no longer compiles.
>
>I don't know which C++ compiler you use, but this is just not correct.
>(I even compiled it without the const just to make sure I wasn't going mad)
>
>I think your knowledge of C++ if slightly lacking.

No, it was actually more of a typo.  It's a feature I don't use so I
forgot the proper syntax.  You are correct.  The proper syntax is 

class A {
    public:
       int x() const;
    };

class B {
    public:
       A a;
       int y() {return a.x() + 5} const;
    };

Does my argument still hold?

David Buck
dbuck@ccs.carleton.ca

_________________________________
| David K. Buck                 |
| dbuck@ccs.carleton.ca         |
| The Object People             |
|_______________________________|
