[webkit-dev] NeverNull<T>

Oliver Hunt oliver at apple.com
Tue Jul 28 16:06:00 PDT 2009


On Jul 28, 2009, at 3:59 PM, Peter Kasting wrote:

> On Tue, Jul 28, 2009 at 3:55 PM, Oliver Hunt <oliver at apple.com> wrote:
> Personally i like the idea of having type system/compiler enforced  
> null checking.
>
> Note that eseidel's proposal is still a runtime check.  One could  
> use template specialization to write a class that gives a compile- 
> time error if you try to assign NULL directly to a pointer, but I'm  
> not enough of a template wizard to know if it could be made to catch  
> all types of assignment (e.g. if you could catch that when a  
> NeverNull<Foo> is initialized by an existing Foo*, that existing  
> pointer must not contain NULL).

Yeah, i know but you can set things up so that the type system makes  
it harder to accidentally assign null.  My patch for the try* mallocs  
made it harder to not check the result of try*.

>
> PK
>
--Oliver
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090728/1b3e4dd0/attachment.html>


More information about the webkit-dev mailing list