Remove move constructor and delegate to copy. - #1866
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details🔇 Additional comments (1)
📝 WalkthroughWalkthrough
ChangesPipeline Special Member Functions
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@include/depthai/pipeline/Pipeline.hpp`:
- Around line 307-310: The move special members in Pipeline are hard-coding
pimpl, which can drift from copy semantics when new fields are added. Update
Pipeline(Pipeline&&) and operator=(Pipeline&&) to reuse the existing copy
behavior directly so move always mirrors copy, using the Pipeline class’s copy
constructor and copy assignment as the source of truth.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 9138aeb6-c523-455c-8e12-46eebaf5d0c8
📒 Files selected for processing (1)
include/depthai/pipeline/Pipeline.hpp
|
Thanks, looks good to me. Will let tests pass and then we can merge :) |
This does not improve anything for the C++ side of things but improves usability for other languages via generated FFI bindings by allowing them to hold bare pointers to a pipeline object without the possibility of C++ move semantics invalidating that memory.
It's probably worth noting that this currently this only happens in a single place and that usage is unable to affect user space, but for the purpose of future guarantees and static assertions made downstream this would be useful.
Summary by CodeRabbit