On Mon, Aug 3, 2015 at 5:06 PM, Karl Tomlinson <mozn...@karlt.net> wrote:
> but I don't see much advantage of public constructors over
> something like
>
>   static already_AddRefed<Foo> Foo::Create()
>
> or
>
>   static nsRefPtr<Foo> Foo::Make()

Fair enough. Though it is somewhat more boilerplate in the class
itself. But maybe not enough to be a concern.

> Constructors also have the potentially awkward feature of never
> failing, and hence the abundance of separate Init() methods.

Technically you can make the ctor take an nsresult out argument. I
think we have a few classes that do that.

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

Reply via email to