It just occurred to me that we have a lot of places in WebKit were we
ASSERT(foo) (where foo is some passed in Foo* pointer which should never be
NULL).
Maybe it would be cleaner/better/whatever if we instead used a template to
do this ASSERTing in a centralized place. The primary advantage would be
that the ASSERTion is clear in the method signature.
void doSomething(Foo* foo)
{
ASSERT(foo);
}
becomes:
void doSomething(NeverNull<Foo> foo)
{
}
Could get nasty when interacting with other templates though. I don't think
we want a NeverNullOwnPtr, or maybe we do?
Does this seem useful to anyone else? Oh c++ experts, does this even seem
possible, seem like it would perform well, not bloat the code size, etc?
-eric
_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev