On Wed, Nov 15, 2017 at 8:44 PM, Nathan Froyd <nfr...@mozilla.com> wrote:

> * initialized lambda captures
>

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.

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

Reply via email to