On 10/26/10 17:29 CDT, osa wrote:
On 10/26/2010 05:09 PM, Andrei Alexandrescu wrote:
Thanks. Defining opAssign for Bar will allow you to use the syntax bar =
null and have it nullify the reference.

I feel stupid, but I do not see how to nullify the Bar reference inside
of opAssign. Again, my problem is that I have
Bar x = new Bar( ... );
and I want x to become null. Is there a workaround for 'cannot
implicitly convert expression (null) of type void* to Foo' which does
not involve low-level trickery like *cast(void**)&x = null?

Oh, I was confused. I thought you had the converse case - a class object inside a struct object. Compiler bug it is.

Andrei

Reply via email to