Why there are no 'physical' object variables (only references)?

Steve Horne stephenwantshornenospam100 at aol.com
Wed Sep 13 03:13:06 PDT 2006


On Wed, 13 Sep 2006 19:02:27 +1000, Reiner Pope
<reiner.pope at REMOVE.THIS.gmail.com> wrote:

>> But I have mixed feelings about C++ const. It has caught errors for
>> me, but not often, and quite often those errors wouldn't exist without
>> 'const' anyway. 
>How can you call that catching errors?

That's down to the definition of 'error', of course. Trying to call a
non-const method for a const object is an error, by definition, in
C++. The fact that you only wanted read a value is besides the point.

Letter of the law vs. practical reality. Be careful what you say, or
the language lawyers will come for you ;-)

-- 
Remove 'wants' and 'nospam' from e-mail.



More information about the Digitalmars-d mailing list