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?