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

Consider whether to add char traits template parameter to basic_socket_iostream etc

Open chriskohlhoff opened this issue 10 years ago • 4 comments

DK thinks it would be wrong and would rather we don't go down this rabbit hole.

chriskohlhoff avatar Feb 27 '15 07:02 chriskohlhoff

However add note that these classes are intended for trafficking in bytes and not characters, and that the conversion from characters to bytes occur elsewhere.

chriskohlhoff avatar Feb 27 '15 08:02 chriskohlhoff

Applied in 597c18b613cae2b339b34e9860c85af2402fda95.

chriskohlhoff avatar Apr 12 '15 04:04 chriskohlhoff

Pre-Lenexa Summary

[socket.streambuf], [socket.iostream]

The suggestion is that the these iostream-related classes should have template parameters for customising the char traits. As noted above, Dietmar said at the time that he would rather we didn't go down this route.

A change was included in revision 5 to add notes that these classes are intended for byte-oriented uses only.

chriskohlhoff avatar May 04 '15 11:05 chriskohlhoff

w.r.t the naming discussion in LEWG in Lenexa, it occurs to me that this is not a std::basic_iostream, it is a basic_socket that reads/writes via a std::iostream i.e. via std::basic_iostream<char, std:char_traits>, and therefore basic_socket_iostream is the perfect name. You can't customise the char_type and you can't customise the traits_type, because it's a std::iostream (and in 99.9% of cases that's exactly what people want).

jwakely avatar May 09 '15 22:05 jwakely