-
Notifications
You must be signed in to change notification settings - Fork 754
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
Support for string_view #611
Comments
The libzmq function take null terminates strings so string views must be converted to strings. Your before example is buggy if the underlying string is not null terminated, use |
Oh okay thanks but maybe it might be a good idea to force the good habits like : void connect(std::string_view addr) { connect(std::string(addr)); } Same for |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version of cppzmq : 4.10.0
Compiler version : 9.4.0
C++ version : 17
I mainly use std::string_view to handle string into my functions and I would like to be able to use them without conversion.
Before :
std::string_view url = "url"; socket.connect(url.data());
After :
std::string_view url = "url"; socket.connect(url);
Here the error :
This is also a problem for bind or zmq::str_buffer.
I would like to try to get it done if possible.
The text was updated successfully, but these errors were encountered: