
I'm using an asio::streambuf to read and write data to a socket. Despite my
best efforts, I can't get the streambuf to throw an exception if I consume
too much. I'm trying to get it to throw an exception so I can test an error
case.
The documentation says streambuf::consume will throw an std::length error if
the requested amount to read is greater than the input stream size (
http://www.boost.org/doc/libs/1_42_0/doc/html/boost_asio/reference/basic_str...).
But in my test program, this did not happen. Do I need to enable exception
throwing somehow? Or is streambuf working as intended and not supposed to
throw an exception?
Here is my test program:
#include <iostream>
#include