[webkit-dev] Ptr<T>

Chinmaya Sn chinmaya at gmail.com
Wed Aug 11 10:49:08 PDT 2010

AutoNull<T> sounds like a good idea, in addition to initializing to zero,
I would like it handle operator-> to not crash ! Something like
handling Java's NullPointerException


On Sat, Aug 7, 2010 at 9:59 PM, Eric Seidel <eric at webkit.org> wrote:
> I just spent a while debugging an error in code I wrote.
> I added a couple new Foo* members to a class.  And forgot to 0 them in
> one of the constructors.
> RefPtr<T>, OwnPtr<T> would have done this for me.  But I wanted these
> to be weak pointers.
> How about we add a Ptr<T> (or WeakPtr<T> or AutoNull<T> or whatever)
> to wtf to stop this nonsense.
> -eric
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

chinmaya sn

More information about the webkit-dev mailing list