Skip to content

Allow using std::string_view instead of ErlNifBinary #4

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

Merged
merged 3 commits into from
Jun 6, 2025

Conversation

brodeuralexis
Copy link
Contributor

Since std::string_view integrates better with the C++ ecosystem and is available in C++17, this commit ensures that it is available as an encodable and decodable type equivalent to ErlNifBinary while keeping ErlNifBinary available if needed.

Since `std::string_view` integrates better with the C++ ecosystem and is
available in C++17, this commit ensures that it is available as an
encodable and decodable type equivalent to `ErlNifBinary` while
keeping `ErlNifBinary` available if needed.
Copy link
Member

@jonatanklosko jonatanklosko left a comment

Choose a reason for hiding this comment

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

Hey @brodeuralexis, this is great, thank you! I was not aware of std::string_view, I think we could actually skip encoder/decoder for ErlNifBinary, but let's keep it to avoid breaking changes (and it doesn't hurt to have it).

@jonatanklosko jonatanklosko merged commit efb899d into elixir-nx:main Jun 6, 2025
7 checks passed
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