Repository navigation
fix(palette): explicit Rule of 5 on detail::TCRGBPalette<N> (#2725) - #2736
Conversation
`-Wdeprecated-copy` fires on `TCRGBPalette<16>::operator=` because the class declares user-defined conversion ctors / assignment operators (taking `TColorPalette<CHSV, Size>` or `const CHSV(&)[Size]`) without also explicitly declaring the same-type copy ctor / copy assign / dtor. C++11+ deprecates relying on the implicit copy-assignment in that case; ~472 hits across teensy30/31/40/41/LC. Fix: add explicit `= default` declarations for the Rule of 5 on `detail::TCRGBPalette<N>`. Mirrors what `CRGBPalette16`, `CRGBPalette32`, `CRGBPalette256`, `CHSVPalette16/32/256` already do at the derived level. Closes #2725. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR adds explicit defaulted declarations of the copy constructor, copy assignment operator, and destructor to ChangesTCRGBPalette special members
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #2725.
Summary
-Wdeprecated-copyfires onTCRGBPalette<16>::operator=because the class declares user-defined conversion ctors / assignment operators (takingTColorPalette<CHSV, Size>orconst CHSV(&)[Size]) without also explicitly declaring the same-type copy ctor / copy assign / dtor. C++11+ deprecates relying on the implicit copy-assignment in that case; ~472 hits across teensy30/31/40/41/LC builds.Fix
Add explicit
= defaultdeclarations for the Rule of 5 ondetail::TCRGBPalette<N>:Mirrors what
CRGBPalette16(colorutils.h:707-709),CRGBPalette32,CRGBPalette256,CHSVPalette16/32/256already do at the derived level. The baseTColorPaletteis fine — it explicitly declares its own copy ctor + copy assign with bodies.Test plan
bash lintcleanbash test fl_gfx_colorutils --cpppasses🤖 Generated with Claude Code
Summary by CodeRabbit