Skip to content

Remove move constructor and delegate to copy. - #1866

Open
thehiddenwaffle wants to merge 3 commits into
luxonis:developfrom
thehiddenwaffle:develop_move_semantics
Open

Remove move constructor and delegate to copy.#1866
thehiddenwaffle wants to merge 3 commits into
luxonis:developfrom
thehiddenwaffle:develop_move_semantics

Conversation

@thehiddenwaffle

@thehiddenwaffle thehiddenwaffle commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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

  • API Improvements
    • Pipeline objects now have clearly defined copy and move behavior, making it easier and more consistent to store, pass around, assign, and return pipeline instances in your application code.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5fcd17da-e4de-4189-9d12-b89c74db2463

📥 Commits

Reviewing files that changed from the base of the PR and between a29d6de and 513b2fe.

📒 Files selected for processing (1)
  • include/depthai/pipeline/Pipeline.hpp
📜 Recent review details
🔇 Additional comments (1)
include/depthai/pipeline/Pipeline.hpp (1)

305-311: LGTM!


📝 Walkthrough

Walkthrough

dai::Pipeline in Pipeline.hpp now explicitly declares defaulted copy and destruction operations, plus noexcept move operations that reuse the copy behavior.

Changes

Pipeline Special Member Functions

Layer / File(s) Summary
Copy/move/destructor declarations
include/depthai/pipeline/Pipeline.hpp
Copy constructor and assignment are defaulted; move constructor and assignment are noexcept and delegate to copy behavior; destructor is defaulted.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

🐇 A pipeline now knows how to stay,
Copy and move in a tidy way.
Defaulted paws and a noexcept hop,
Then the destructor gives one final stop.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title captures the main intent of replacing move semantics with copy-backed behavior in Pipeline.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7cd3235 and a29d6de.

📒 Files selected for processing (1)
  • include/depthai/pipeline/Pipeline.hpp

Comment thread include/depthai/pipeline/Pipeline.hpp Outdated
@aljazkonec1

Copy link
Copy Markdown
Collaborator

Thanks, looks good to me. Will let tests pass and then we can merge :)

aljazkonec1
aljazkonec1 previously approved these changes Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants