chriskohlhoff / asio-tr2

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

basic_socket::at_mark(error_code&) doesn't say what it returns on error #204

Closed jwakely closed 9 years ago

jwakely commented 9 years ago

The Filesystem TS deals with this like:

The signature with argument ec returns false if an error occurs.

basic_socket::available() says "or 0 if an error occurs" which isn't clear whether that applies to both overloads, or only the one taking an error_code.

chriskohlhoff commented 9 years ago

Can the rules in [err.report.sync] be tweaked to cover this so we don't have to repeat this formulation everywhere? (Perhaps it already does cover it but could be made clearer.)

chriskohlhoff commented 9 years ago

Sorry, didn't read carefully enough.... I realise now what you're saying. At_mark is missing the return specification.

chriskohlhoff commented 9 years ago

Fixed at_mark in 8761408d6124099703ff8105dca82f18b489475c. Let me know if you think [err.report.sync] should also be changed.

jwakely commented 9 years ago

I think [err.report.sync] is clear enough, and does cover cases like basic_socket::available(). Thanks