From -6904021555458557631
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,f9d03435d36a70ff
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1990-08-20 13:43:37 PST
Path: gmdzi!unido!mcsun!uunet!microsoft!jimad
From: jimad@microsoft.UUCP (Jim ADCOCK)
Newsgroups: comp.std.c++
Subject: Re: 'const' revisited
Message-ID: <56745@microsoft.UUCP>
Date: 20 Aug 90 18:38:37 GMT
References: <26909@pasteur.Berkeley.EDU> <11194@alice.UUCP> <140877@sun.Eng.Sun.COM> <CIMSHOP!DAVIDM.90Aug20002153@uunet.UU.NET>
Reply-To: jimad@microsoft.UUCP (Jim ADCOCK)
Distribution: comp
Organization: Microsoft Corp., Redmond WA
Lines: 19
Posted: Mon Aug 20 19:38:37 1990

In article <CIMSHOP!DAVIDM.90Aug20002153@uunet.UU.NET> cimshop!davidm@uunet.UU.NET (David S. Masterson) writes:
>
>I agree with this sentiment, but think the thrust should be reversed (in
>general).  That is, I think #pragma's should be used to give the compiler
>hints that standard optimization will not work with the current program.  The
>language itself (since it derives from C) should promote optimization in its
>structure, not as a by-product of implementation specifics (as in the
>#pragma's).

I think this is a pretty good solution.  Its only disadvantage is that the
#pramga's need to be in the .h files, further eroding the distinct 
between specification and implementation.  But, if you don't do it,
you don't see the ugliness in your .h files....

This ties in well with the C++ philosophy that people who don't need a 
feature shouldn't be the ones to pay for it -- people who don't cast
away from const shouldn't pay a price for those who do cast-away consts.
I like this a lot better than Koenig's suggestion where everybody has
to pay the price for cast-aways!


