On Wed, Aug 13, 2014 at 3:14 PM, Aryeh Gregor <a...@aryeh.name> wrote:
> It has
> the disadvantage that you could still not pass an already_AddRefed
> directly to a function that wants T*, which is unfortunate because
> it's perfectly safe to do so.  I can't think of any way to avoid that
> except defining new types for refcounted parameters to use instead of
> raw pointers (which would have other uses as well).

Actually, once already_AddRefed releases its pointer on destruction,
we could just add a get() method and use that when we do want to
convert to T* (like when passing to a function).  Certainly much
shorter than explicitly constructing an nsCOMPtr<T>.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to