Yeah, maybe this bit of C++ syntax isn't the best idea. What about other alternatives?
You could try testing for null before dereferencing ;-)If the following code in D, did what you'd reasonably expect it to do, then you could do this:
-----
module test;
import std.stdio;
class C { public int x; }
void main()
{
try
{
C c = null;
c.x = 100;
}
catch(Exception e)
{
writeln(e.msg);
}
}
-----
