Repository navigation
use default copy constructor and copy assignments for CRGB and CHSV - #990
Merged
Merged
Conversation
This was referenced Mar 28, 2020
Closed
Contributor
Author
|
I've noticed that I could've made the default constructor trivial. |
Member
|
Thanks for the help with this, and the code fixes. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fix for class-memaccess warnings for the
CRGBandCHSVstructs.fixes the same warnings as #986 (discussion #985) and #977 (discussion #971)(which are duplicates), except that this removes the warning from all uses that require
CRGBandCHSVto be trivially copyable.As littlebalckfish said
Quote
the
memmovesignature takesvoid *as arguments and the warnings could be avoided by casting tovoid *, but the warnings could be completely removed forCRGBandCHSVby making both have a trivial copy assignment and a trivial copy constructor. Thus removing warnings when using for examplememmovein user code and in the future.Performance wise this shouldn't make a difference, but please test it. I've done a bit of testing myself and haven't found any real performance difference although I'm not sure how good my tests are.