Timon Gehr , dans le message (digitalmars.D:167544), a écrit : > Leaving the rule out would imply that the currently valid code > transformation: > > int foo(const pure A){ } > > A a = ...; > > int x=foo(a), y=foo(a) > => > int x=foo(a), y=x; > > would become incorrect in the general case. The proposal trades off > 'const' guarantees against mutable/immutable interoperability. I would > be willing to take that.
The language could declare that the transformation is legal, and that the programmer using 'mutable' members is responsible for keeping the function logically const. -- Christophe