On Friday, November 17, 2017 at 6:05:38 AM UTC+11, Jeff Walden wrote: > 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
Please note one hurdle before C++14 can actually be used: https://bugzilla.mozilla.org/show_bug.cgi?id=1418047 This should hopefully land soon. Then let the floodgates open, and let us yearn for C++17 features we suddenly *need* right now! :-) Gerald _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform