Simplify ctors with default member initializer

Authored by dhaumann on Aug 9 2019, 12:33 AM.


Group Reviewers

In my experience it has these advantages:

  • harder type checks,
  • allows to use = default ctor,
  • simplify ctors.

// I hope this time, I've created "ok" diff.

Diff Detail

R40 Kate
Lint Skipped
Unit Tests Skipped
gawin created this revision.Aug 9 2019, 12:33 AM
Restricted Application added a subscriber: kwrite-devel. ยท View Herald TranscriptAug 9 2019, 12:33 AM
gawin requested review of this revision.Aug 9 2019, 12:33 AM
cullmann accepted this revision.Aug 9 2019, 6:02 AM
cullmann added a subscriber: cullmann.

Looks good for me, thanks!

This revision is now accepted and ready to land.Aug 9 2019, 6:02 AM

Can you pass me name + author for the git commit?

Did you make these changes manually, or use clang-tidy for it?

Personally, I would prefer the = member init syntax over the braced initialization. This is how we did it in most other cases already as well where we use in-class member initialization.

gawin added a comment.Aug 9 2019, 9:35 AM

@cullmann: Filip Gawin,

@dhaumann: yeah, clang-tidy. Isn't {} syntax better, I mean it prevents implicit conversion? (But yeah meaningless with pointers.)

@gawin: hello; how are you creating the diff? if you haven't used arc diff, that could be one reason why the commit authorship is messed up.

cullmann requested changes to this revision.Aug 13 2019, 7:58 PM

I think Dominik is right and = would be nicer.

This revision now requires changes to proceed.Aug 13 2019, 7:58 PM
kfunk added a subscriber: kfunk.Aug 14 2019, 2:03 PM

I think Dominik is right and = would be nicer.

Note there's this UseAssignment option in the clang-tidy checker you can (and should) use. Just trying to preserve you from having to go through the diff manually :)

gawin added a comment.Aug 22 2019, 3:41 PM

I've tried to use arc for this. It created new PR.

dhaumann commandeered this revision.Aug 22 2019, 5:03 PM
dhaumann abandoned this revision.
dhaumann added a reviewer: gawin.

Abandon in favor of D23351.