Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<class MutableBufferSequence>
- std::size_t read(MutableBufferSequence const&)
- {
- throw std::exception{};
- }
- void
- example()
- {
- std::string s;
- assert(s.empty());
- try
- {
- auto b = boost::asio::dynamic_buffer(s);
- b.commit(read(b.prepare(32)));
- }
- catch(std::exception const&)
- {
- assert(s.empty()); // fails
- }
- }
Add Comment
Please, Sign In to add comment