C and C++ could have non_nullable pointers, easily
C and C++ could have non_nullable pointers, easily
Posted Aug 21, 2009 7:48 UTC (Fri) by dgm (subscriber, #49227)In reply to: C and C++ could have non_nullable pointers, easily by nix
Parent article: Null pointers, one month later
This would be useful if the type system _forced_ you to check before assigning a maybe-null-pointer to a never-null-pointer. And to be really useful, only never-null-pointers should be dereferenced, and the compiler would only allow pointer arithmetic on maybe-null-pointers.
The gotcha is that null pointers are just _one_ type of invalid pointer.
