const methods()

Mike mike at mike.com
Mon Jan 22 05:44:20 PST 2007


D doesnt seem to have any way of protecting a class object from being changed
by non-const functions. For example in C++ I can declare a class reference as
const, so no one can call any methods on that reference that would change the
contents of the object. Why can you not do this in D? What is the alternative
line of thought to this?



More information about the Digitalmars-d mailing list