-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Suppress Clang-Tidy warning #4311
Open
nlohmann
wants to merge
27
commits into
develop
Choose a base branch
from
clang-tidy
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
57e22b9
:rotating_light: suppress warning
nlohmann b131d28
:rotating_light: fix warning
nlohmann 7b89d3a
:rotating_light: fix warning
nlohmann cc4d7f1
:rotating_light: fix warning
nlohmann 22d3ee9
:rotating_light: fix warning
nlohmann 91be9e0
:rotating_light: fix warning
nlohmann 8ef2759
:rotating_light: fix warning
nlohmann 414345e
:rotating_light: fix warning
nlohmann 760f54f
:rotating_light: fix warning
nlohmann e8cfe1f
:rotating_light: fix warning
nlohmann 4b7721c
:rotating_light: fix warning
nlohmann bb2468a
:rotating_light: fix warning
nlohmann 751b936
:rotating_light: fix warning
nlohmann 3c28221
:rotating_light: fix warning
nlohmann fd96812
:rotating_light: fix warning
nlohmann 88318f9
:twisted_rightwards_arrows: merge develop
nlohmann 83dc915
:ambulance: fix warning
nlohmann c4ec5e0
Merge branch 'develop' into clang-tidy
nlohmann b48e05b
:green_heart: update actions
nlohmann 9240ba4
Merge remote-tracking branch 'origin/clang-tidy' into clang-tidy
nlohmann ddecb70
:rotating_light: fix warning
nlohmann 078d25e
:rotating_light: fix warning
nlohmann ad552c4
:rotating_light: fix warning
nlohmann 9561a12
:rotating_light: fix warning
nlohmann 5e9bf55
# Conflicts:
nlohmann a65d65c
:twisted_rightwards_arrows: merge develop
nlohmann 2e928c3
:twisted_rightwards_arrows: merge develop
nlohmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can we just do
assert_invariant(false);
in the body (assert it inthis
after moving instead of asserting inother
) to avoid this mess?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.
Another possibility for avoiding all these issues is to do
std::swap()
onm_data
andother.m_data
in the body.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 am not at all happy with this. I also thought about swapping...
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.
Sorry for asking a question for something that is probably obvious, but which constructor of
json_base_class_t
is this call valid for? I suppose it is one of thebasic_json
constructors being used here?FWIW, it should be completely fine to check the invariants after the initializer list has been evaluated. Is there a possibility to consider rewriting the
data
move constructor so these assignments don't need to be done at this level?