Tidy up buffers_range

This commit is contained in:
Vinnie Falco
2019-07-01 10:42:43 -07:00
parent ce1c6d3222
commit 9e0564044f
2 changed files with 5 additions and 13 deletions

View File

@@ -6,6 +6,7 @@ Version 261:
* Simplify websocket::detail::prng * Simplify websocket::detail::prng
* Don't over-allocate in http::basic_fields * Don't over-allocate in http::basic_fields
* Fix multi_buffer allocation alignment * Fix multi_buffer allocation alignment
* Tidy up buffers_range
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

View File

@@ -38,13 +38,9 @@ public:
buffers_iterator_type<BufferSequence>; buffers_iterator_type<BufferSequence>;
iter_type it_{}; iter_type it_{};
buffers_range_adaptor const* b_ = nullptr;
const_iterator( const_iterator(iter_type const& it)
buffers_range_adaptor const& b,
iter_type const& it)
: it_(it) : it_(it)
, b_(&b)
{ {
} }
@@ -62,7 +58,7 @@ public:
bool bool
operator==(const_iterator const& other) const operator==(const_iterator const& other) const
{ {
return b_ == other.b_ && it_ == other.it_; return it_ == other.it_;
} }
bool bool
@@ -111,11 +107,6 @@ public:
} }
}; };
buffers_range_adaptor(
buffers_range_adaptor const&) = default;
buffers_range_adaptor& operator=(
buffers_range_adaptor const&) = default;
explicit explicit
buffers_range_adaptor(BufferSequence const& b) buffers_range_adaptor(BufferSequence const& b)
: b_(b) : b_(b)
@@ -125,13 +116,13 @@ public:
const_iterator const_iterator
begin() const noexcept begin() const noexcept
{ {
return {*this, net::buffer_sequence_begin(b_)}; return {net::buffer_sequence_begin(b_)};
} }
const_iterator const_iterator
end() const noexcept end() const noexcept
{ {
return {*this, net::buffer_sequence_end(b_)}; return {net::buffer_sequence_end(b_)};
} }
}; };