Path: utzoo!attcan!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> Reply-To: jimad@microsoft.UUCP (Jim ADCOCK) Distribution: comp Organization: Microsoft Corp., Redmond WA Lines: 19 In article 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!