Skip to content

Introduce crubit::Value for C++ move semantics.#1419

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_947125630
Open

Introduce crubit::Value for C++ move semantics.#1419
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_947125630

Conversation

@copybara-service

Copy link
Copy Markdown

Introduce crubit::Value for C++ move semantics.

crubit::Value<T> is a wrapper that enables C++ move semantics for
types that are Rust-movable (i.e. support relocation) but not C++-movable.
It introduces a "moved-from" state using a boolean flag, and uses
UnsafeRelocateTag constructors when available to perform the move.

This is useful for passing non-C++-movable Rust types by value in C++
by wrapping them in Value<T>.

@google-cla

google-cla Bot commented Jul 13, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@copybara-service copybara-service Bot force-pushed the test_947125630 branch 3 times, most recently from 450f854 to ac0ab7f Compare July 14, 2026 16:31
`crubit::Value<T>` is a wrapper that enables C++ move semantics for
types that are Rust-movable (i.e. support relocation) but not C++-movable.
It introduces a "moved-from" state using a boolean flag, and uses
`UnsafeRelocateTag` constructors when available to perform the move.

This is useful for passing non-C++-movable Rust types by value in C++
by wrapping them in `Value<T>`.

PiperOrigin-RevId: 947125630
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.

0 participants