0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-18 07:50:57 +01:00

ircd::buffer: Allow returning completed() mutable_buffer.

This commit is contained in:
Jason Volk 2018-01-14 17:58:21 -08:00
parent 314bcb3d30
commit af0c02cc10

View file

@ -421,6 +421,14 @@ struct ircd::buffer::stream_buffer
return { base.begin(), base.begin() + consumed() };
}
/// View the completed portion of the stream
mutable_buffer completed()
{
assert(base.begin() <= begin());
assert(base.begin() + consumed() <= base.end());
return { base.begin(), base.begin() + consumed() };
}
/// Convenience conversion to get the completed portion
explicit operator const_buffer() const
{