Transitive const sucks

Steven Schveighoffer schveiguy at yahoo.com
Tue Sep 11 08:35:18 PDT 2007


"Janice Caron" wrote
> What all of these use-cases have in common is the fact that the state is 
> private
>
> Suppose that all class and struct members which were declared private, 
> were always mutable,
> even if the class instance is const.

I sort of agree with you, but what about instances where you want derived 
classes to be able to access the cache?

I think having a keyword for mutable is necessary, but what may make sense 
is to enforce that only non-public members are allowed to be mutable.

What is the argument against mutable again?

-Steve 





More information about the Digitalmars-d mailing list