On 12/13/2013 04:24 PM, Andrea Fontana wrote:

> Just another thought. If we have:
>
> class B;
> struct C;
>
> class A
> {
>     void method() const { ... }
>     B another_class;
>     C a_struct;
> }
>
> B is just a reference to a object, so method() should not reassign it.
> The reference should be const, not the object itself. method() should be
> able to call mutable another_class methods.

However, according to how D sees constness, mutating another_class through its non-const methods would mutate the state of A as well.

Ali

Reply via email to