Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CxxVector::new for creating an empty vector #1262

Merged
merged 3 commits into from
Aug 29, 2023

Conversation

capickett
Copy link
Contributor

When constructing a CxxVector to pass to C++, you have to end up writing your own utility function that constructs a UniquePtr<CxxVector<...>> and add that to your projects cxx bridge. Creating an empty vector seems like a simple enough task to afford having an API for it on CxxVector.

Copy link
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Thanks, looks good so far. You'll also need some changes in gen/src/write.rs (this is why linking failed with MSVC in CI).

@capickett
Copy link
Contributor Author

Thanks, looks good so far. You'll also need some changes in gen/src/write.rs (this is why linking failed with MSVC in CI).

Thanks for the pointer!

Copy link
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Thanks!

@dtolnay dtolnay merged commit 13ee65e into dtolnay:master Aug 29, 2023
15 checks passed
@dtolnay
Copy link
Owner

dtolnay commented Aug 29, 2023

Published in cxx 1.0.107.

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.

2 participants