The only advantage of std::function that I know of is that it is copyable. Unless you really need to copy your lambda for a reason or another, I don’t see a good reason to ever use std::function instead of WTF::Function.
I have been slowly replacing std::function by WTF::Function in the code base but there are still a lot of uses of std::function. -- Chris Dumez > On Jun 13, 2017, at 9:24 AM, Darin Adler <da...@apple.com> wrote: > > I’ve noticed many patches switching us from std::function to WTF::Function > recently, to fix problems with copying and thread safety. > > Does std::function have any advantages over WTF::Function? Should we ever > prefer std::function, or should we use WTF::Function everywhere in WebKit > where we would otherwise use std::function? > > — Darin > _______________________________________________ > webkit-dev mailing list > webkit-dev@lists.webkit.org > https://lists.webkit.org/mailman/listinfo/webkit-dev
_______________________________________________ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev