chriskohlhoff / asio-tr2

C++ TR2 proposal based on Asio
17 stars 5 forks source link

Consider whether to add char traits template parameter to basic_socket_iostream etc #134

Open chriskohlhoff opened 9 years ago

chriskohlhoff commented 9 years ago

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

chriskohlhoff commented 9 years ago

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 commented 9 years ago

Applied in 597c18b613cae2b339b34e9860c85af2402fda95.

chriskohlhoff commented 9 years ago

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.

jwakely commented 9 years ago

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