
Richard Smith wrote:
The example in the documentation for the Source concept in Boost.Iostreams says:
std::streamsize read(char* s, std::streamsize n) { // Read up to n characters from the input // sequence into the buffer s, returning // the number of characters read, or -1 // to indicate end-of-sequence. }
(The same text appears in 'valid expressions / semantics' table, which is probably more definitive.)
What does a return of less than n actually mean?
I think the tutorial example for the multi-char shell comments filter gives an example of one such case (c == WOULD_BLOCK). see: http://www.boost.org/doc/libs/1_39_0/libs/iostreams/doc/tutorial/multichar_f... The meaning of WOULD_BLOCK is mentioned in the section where they create this same filter as a regular input filter. http://www.boost.org/doc/libs/1_39_0/libs/iostreams/doc/tutorial/shell_comme...