Weed wrote:
Christopher Wright пишет:
It's more expensive than dereferencing. If your const object points to
its reference count, then the reference count is also const, so you
can't alter it.

It is designed not so. There will be a hidden dereferencing:

const ref Obj object -> struct{ Obj* object;    -> Obj object;
                                int counter; };

Okay, a language level feature, or a wrapper struct. That would work. If it's a library level feature, there's a problem of usage.

Reply via email to