Ticket #9259: container_device.diff
File container_device.diff, 1.2 KB (added by , 9 years ago) |
---|
-
.hpp
old new 13 13 #include <boost/config.hpp> // BOOST_NO_STDC_NAMESPACE. 14 14 #include <boost/iostreams/categories.hpp> 15 15 #include <boost/iostreams/detail/ios.hpp> // failure. 16 #include <boost/iostreams/positioning.hpp> // stream_offset 16 17 17 18 namespace boost { namespace iostreams { namespace example { 18 19 … … 113 114 pos_ += result; 114 115 } 115 116 if (result < n) { 116 container_.insert(container_.end(), s , s + n);117 container_.insert(container_.end(), s + result, s + n); 117 118 pos_ = container_.size(); 118 119 } 119 120 return n; … … 129 130 } else if (way == BOOST_IOS::cur) { 130 131 next = pos_ + off; 131 132 } else if (way == BOOST_IOS::end) { 132 next = container_.size() + off - 1;133 next = container_.size() + off; 133 134 } else { 134 135 throw BOOST_IOSTREAMS_FAILURE("bad seek direction"); 135 136 } 136 137 137 138 // Check for errors 138 if (next < 0 || next > =container_.size())139 if (next < 0 || next > container_.size()) 139 140 throw BOOST_IOSTREAMS_FAILURE("bad seek offset"); 140 141 141 142 pos_ = next;