On Tue, Aug 4, 2015 at 8:55 PM, Jeff Walden <jwalden+...@mit.edu> wrote:

> On 08/02/2015 07:17 AM, smaug wrote:
> > MakeAndAddRef would have the same problem as MakeUnique. Doesn't really
> tell what type is returned.
>
> For the MakeUnique uses I've added (doubtless many more have popped up
> since), I've pretty much always tried to use |auto|.  MakeUnique, and
> std::make_unique if STLport ever dies the final death, should IMO be
> considered idiomatic.  If you read them, you *know* that what's returned is
> a uniquely owned pointer.  And by the very nature of these types, only one
> owner ever exists, so ownership/lifetime issues shouldn't exist.
>
> For the exact same reasons the results of casts should be auto-able, I
> think the result of MakeUnique should also be auto-able.


+1

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

Reply via email to