-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++20 #168
C++20 #168
Conversation
…perator fix warning -Wdeprecated-copy-with-dtor
Needed to fix 'definition of implicit copy constructor for 'LCObject' is deprecated because it has a user-declared destructor'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already looks good. Just some nit-picking from my side since we are already at it.
LCObject() = default ; | ||
LCObject(LCObject const&) = default ; | ||
LCObject& operator=(LCObject const&) = default ; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the move constructors here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was no error about missing or implicitly defined move constructors.
Should I add them with default
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not entirely trivial in this case on whether it will be implicitly default
ed, or implicitly delete
d in the cases that we have here: https://en.cppreference.com/w/cpp/language/move_constructor
For LCObject
and in general for all the abstract interfaces I think explicitly default
ing them should be fine, IIUC. (At least then they should not prevent anything in the Impl
classes).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the default move constructors.
@@ -27,8 +27,7 @@ class TrackState : public LCObject { | |||
|
|||
public: | |||
/// Destructor. | |||
virtual ~TrackState() = default; | |||
|
|||
//virtual ~TrackState() { /* nop */; } // implicit! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//virtual ~TrackState() { /* nop */; } // implicit! | |
//virtual ~TrackState() = default; // implicit! |
Personal preference for indicating that this is no-op. On the other hand we could also entirely remove the commented one here, c.f. rule of 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the commenting, this change is because I didn't start from the HEAD of master and the line was actually changed, and when I solved the conflict I just took the line from my changes. Yes, completely removing is fine of course
PS: cf. is one word, cf. https://en.wikipedia.org/wiki/Cf. /nitpick
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the commented line
@@ -15,6 +15,8 @@ namespace SIO { | |||
typedef long long long64 ; | |||
|
|||
RunEvent() = default ; | |||
RunEvent(RunEvent const&) = default ; | |||
RunEvent& operator=(RunEvent const&) = default ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about move constructors here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
@@ -27,6 +27,8 @@ namespace IMPL { | |||
/** Default constructor, initializes values to 0. | |||
*/ | |||
TrackStateImpl() ; | |||
TrackStateImpl(TrackStateImpl const&) = default ; | |||
TrackStateImpl& operator=(TrackStateImpl const&) = default ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Different class, same question: What about move constructors here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
BEGINRELEASENOTES
ENDRELEASENOTES
Fixes for example