Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

mozilla::NotNull

37 views
Skip to first unread message

Nicholas Nethercote

unread,
Jul 14, 2016, 8:27:37 PM7/14/16
to dev-platform
Hi,

mozilla::NotNull is a recent addition to MFBT. It is used to mark
pointers (both raw and smart) that are never null, e.g.:

- NotNull<char*>
- NotNull<RefPtr<Event>>
- NotNull<nsCOMPtr<Event>>

It's most useful when used in function parameters and class members,
more so than local variables. Its use can clarify APIs, and also help
identify missing null checks and unnecessary null checks.

See the comments in mfbt/NotNull.h for more details.

Nick
0 new messages