asio-tr2 icon indicating copy to clipboard operation
asio-tr2 copied to clipboard

Consider whether we can remove const char* overloads for make_address_*()

Open chriskohlhoff opened this issue 10 years ago • 1 comments

chriskohlhoff avatar Feb 27 '15 08:02 chriskohlhoff

Pre-Lenexa Summary

[internet.address.creation], [internet.address.v4.creation], [internet.address.v6.creation]

The proposal is that we only need to provide the string_view overloads. However, string_view strings are not guaranteed to be null-terminated. This means that an implementation that uses inet_ntop and inet_pton needs to copy the string to a temporary buffer first. By providing the const char* overloads we give the user an option for avoiding this copy.

In Cologne, Jonathan Wakely indicated that he would probably want to provide the additional const char* overloads anyway, but it's not clear to me if this is permitted.

chriskohlhoff avatar May 04 '15 10:05 chriskohlhoff