On 2/7/2012 7:58 PM, Daniel Murphy wrote:
It seems the problem you've run into is that a class reference cannot be
tail-const.

Pointers can be tail-const like this:
const(Data)*
but there is no way currently (there are proposals) to make only the data
and not the reference const.

A workaround is to use Rebindable in std.typecons.

An array of references to const classes becomes:
(Rebindable!const(Class))[]



Thanks, both answers mentioned Rebindable, looks like it may be very useful. I actually did use the const(Class)* solution, which puts the referencing requirement on the caller, but that's not a huge deal.

Reply via email to