Skip to content

Allow using std::string_view instead of ErlNifBinary#4

Merged
jonatanklosko merged 3 commits into
elixir-nx:mainfrom
brodeuralexis:feature/string_view
Jun 6, 2025
Merged

Allow using std::string_view instead of ErlNifBinary#4
jonatanklosko merged 3 commits into
elixir-nx:mainfrom
brodeuralexis:feature/string_view

Conversation

@brodeuralexis

Copy link
Copy Markdown
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.

@jonatanklosko jonatanklosko left a comment

Copy link
Copy Markdown
Member

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).

Comment thread README.md Outdated
Comment thread include/fine.hpp Outdated
@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