On 7/22/2013 4:40 AM, Neil wrote:
Robert O'Callahan wrote:

On Mon, Jul 22, 2013 at 3:58 PM, L. David Baron <dba...@dbaron.org> wrote:

Is the idea here that nsRefPtr/nsCOMPtr/etc. would have move constructors, and we'd just return them, and the move constructors plus return value optimizations would take care of avoiding excess reference counting?

That, plus forget() returns a nsRefPtr.
You mean that if we changed things, forget would return a nsRefPtr? It currently returns an already_AddRefed.



Historically people used refptr.forget().get(); to get a raw addrefed pointer.
This is the way I prefer to return an already addrefed pointer through an outparam. I feel that it is more explicit and easier to read than

comptr.forget(outparam);

--BDS

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to