if (p) p-> func() ;There's got to be a way of making a NULL safe pointer. You can already delete NULL if you want to, no harm there. How about letting us deref NULL or call it: NULL-> func() which of course would do nothing. Fine, there's some implementation details to work out, like what's the return type for * NULL, but if I can just cut out 90% of my
return (p) ? * p : NULL ;I'll be happy. Time to put the old thinking hat on.