On 11/16/2017 08:35 AM, Ben Kelly wrote:
> I would like to use initialized lambda capture as I think it will allow
> move-only objects to be used in lambdas like this:
>
> UniquePtr<Thing> uniqueThing = MakeUnique<Thing>();
> nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([uniqueThing =
> Move(uniqueThing)] () {
> uniqueThing->Stuff();
> });
> thread->Dispatch(r.forget());
>
> Thanks.
Do it! https://bugzilla.mozilla.org/show_bug.cgi?id=1322962 was WONTFIX'd for
adding a dodgy workaround for this purpose, so it is expected that people will
do/use this in this manner.
Jeff
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform