RESOLVED FIXED 178528
Use "= default" to denote default constructor or destructor
https://bugs.webkit.org/show_bug.cgi?id=178528
Summary Use "= default" to denote default constructor or destructor
Daniel Bates
Reported 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.
Attachments
Patch (564.37 KB, patch)
2017-10-19 12:13 PDT, Daniel Bates
aestes: review+
Daniel Bates
Comment 1 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.
Daniel Bates
Comment 2 2017-10-19 16:49:03 PDT
Joseph Pecoraro
Comment 3 2017-10-22 18:14:50 PDT
Is there an advantage to this?
Daniel Bates
Comment 4 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
Joseph Pecoraro
Comment 5 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.
Radar WebKit Bug Importer
Comment 6 2017-11-15 13:02:16 PST
Note You need to log in before you can comment on or make changes to this bug.