Logical const

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Nov 29 10:06:17 PST 2010


On 11/29/10 10:24 AM, Steven Schveighoffer wrote:
> This only solves the caching issue (which I agree is a large issue).
> There are other cases where you want a mutable pointer to other data
> that the object does not own. Such as a widget having a pointer to its
> window. Assuming that window draw routines need to be non-const, a
> widget cannot draw itself. You need to keep the widget to window
> relationship outside the class, or cast. Both of these solutions are
> awkward at best.

Would Rebindable help that situation?

>> I recall I managed to convince Walter that the system works, but we
>> agreed it would cost too much for what it does. I think it can be
>> implemented as a library artifact under certain assumptions.
>
> It would be nice to have user-defined annotations, so we could play with
> possible implementations. As I recall, the acceptance of annotations in
> D had not occurred when logical const was last discussed, and this seems
> like a perfect candidate for annotations.

Absent annotations, would a parameterized type suffice?


Andrei



More information about the Digitalmars-d mailing list