On Sunday, 30 September 2018 at 09:30:38 UTC, Vijay Nayar wrote:
Is there a way to either have a constant reference to a class
that can be set to a new value, or is there a way to convert
the class variable to a class pointer?
Alex has mentioned Rebindable, which is the answer to your first
question.
To answer your second question, no
class A {}
A a:
`a` is always a (possibly null) reference to a class instance.
You can have pointers to class references (which is what `&a`
gives you) but that has two indirections between the variable and
the data, which if you want high perf is probably not what you
are looking for.