|Summary:||Use "= default" to denote default constructor or destructor|
|Product:||WebKit||Reporter:||Daniel Bates <dbates>|
|Component:||WebCore Misc.||Assignee:||Daniel Bates <dbates>|
|Severity:||Normal||CC:||aestes, joepeck, webkit-bug-importer|
|Version:||WebKit Local Build|
Description Daniel Bates 2017-10-19 11:56:44 PDT
Use "= default" to denote default constructor or destructor instead of defining an empty function. This helps makes default constructors/destructors stand out from other functions as well as makes them searchable.
Comment 1 Daniel Bates 2017-10-19 12:13:23 PDT
Created attachment 324261 [details] Patch This a large change. ItIt is entirely mechanical. Mark default constructors and destructors with "= default" and remove their body. With the exception of Payment.h I left unnecesary explicit declarations of constructors and destructors in the code to keep this patch as consistent as possible to hopefully make it easy to review. In a follow up patch we can remove such declarations as the compiler will generate these functions for us.
Comment 2 Daniel Bates 2017-10-19 16:49:03 PDT
Committed r223728: <https://trac.webkit.org/changeset/223728>
Comment 3 Joseph Pecoraro 2017-10-22 18:14:50 PDT
Is there an advantage to this?
Comment 4 Daniel Bates 2017-10-22 19:38:01 PDT
(In reply to Joseph Pecoraro from comment #3) > Is there an advantage to this? https://stackoverflow.com/questions/20828907/the-new-keyword-default-in-c11
Comment 5 Joseph Pecoraro 2017-10-23 11:50:47 PDT
(In reply to Daniel Bates from comment #4) > (In reply to Joseph Pecoraro from comment #3) > > Is there an advantage to this? > > https://stackoverflow.com/questions/20828907/the-new-keyword-default-in-c11 Thanks. Something to this effect should absolutely have been in the ChangeLog explaining why this change was made. The reason stated in the bugzilla bug was "This helps makes default constructors/destructors stand out from other functions as well as makes them searchable." which is not the same justification as the link you provided, nor would I necessarily agree with it. But using `= default` to make some classes be treated as POD / Trivial is an observable change that we might benefit from.