new D2.0 + C++ language
Christopher Wright
dhasenan at gmail.com
Fri Mar 20 05:06:17 PDT 2009
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.
More information about the Digitalmars-d
mailing list